aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-03-19 02:31:16 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:23 +0800
commit22314d387813c467038e3cb5c87f99c9d731aeef (patch)
tree7982daeb25be64dd16f4e74e5784dee12f95a996
parentb8bcab7f7321eab5a5f29ae058bd05640b0da1c7 (diff)
downloadgo-tangerine-22314d387813c467038e3cb5c87f99c9d731aeef.tar
go-tangerine-22314d387813c467038e3cb5c87f99c9d731aeef.tar.gz
go-tangerine-22314d387813c467038e3cb5c87f99c9d731aeef.tar.bz2
go-tangerine-22314d387813c467038e3cb5c87f99c9d731aeef.tar.lz
go-tangerine-22314d387813c467038e3cb5c87f99c9d731aeef.tar.xz
go-tangerine-22314d387813c467038e3cb5c87f99c9d731aeef.tar.zst
go-tangerine-22314d387813c467038e3cb5c87f99c9d731aeef.zip
core: vm: fix naming consistency
-rw-r--r--core/vm/oracle_contracts.go18
-rw-r--r--core/vm/oracle_contracts_test.go4
2 files changed, 11 insertions, 11 deletions
diff --git a/core/vm/oracle_contracts.go b/core/vm/oracle_contracts.go
index e58133990..a1ac8ed7b 100644
--- a/core/vm/oracle_contracts.go
+++ b/core/vm/oracle_contracts.go
@@ -615,7 +615,7 @@ func (s *GovernanceState) ClearDKGComplaints() {
s.erase1DByteArray(big.NewInt(dkgComplaintsLoc))
}
-// mapping(address => bool) public dkgReady;
+// mapping(address => bool) public dkgMPKReadys;
func (s *GovernanceState) DKGMPKReady(addr common.Address) bool {
mapLoc := s.getMapLoc(big.NewInt(dkgReadyLoc), addr.Bytes())
return s.getStateBigInt(mapLoc).Cmp(big.NewInt(0)) != 0
@@ -628,13 +628,13 @@ func (s *GovernanceState) PutDKGMPKReady(addr common.Address, ready bool) {
}
s.setStateBigInt(mapLoc, res)
}
-func (s *GovernanceState) ClearDKGMPKReady(dkgSet map[coreTypes.NodeID]struct{}) {
+func (s *GovernanceState) ClearDKGMPKReadys(dkgSet map[coreTypes.NodeID]struct{}) {
for id := range dkgSet {
s.PutDKGMPKReady(IdToAddress(id), false)
}
}
-// uint256 public dkgReadysCount;
+// uint256 public dkgMPKReadysCount;
func (s *GovernanceState) DKGMPKReadysCount() *big.Int {
return s.getStateBigInt(big.NewInt(dkgReadysCountLoc))
}
@@ -646,7 +646,7 @@ func (s *GovernanceState) ResetDKGMPKReadysCount() {
s.setStateBigInt(big.NewInt(dkgReadysCountLoc), big.NewInt(0))
}
-// mapping(address => bool) public dkgFinalized;
+// mapping(address => bool) public dkgFinalizeds;
func (s *GovernanceState) DKGFinalized(addr common.Address) bool {
mapLoc := s.getMapLoc(big.NewInt(dkgFinalizedLoc), addr.Bytes())
return s.getStateBigInt(mapLoc).Cmp(big.NewInt(0)) != 0
@@ -659,7 +659,7 @@ func (s *GovernanceState) PutDKGFinalized(addr common.Address, finalized bool) {
}
s.setStateBigInt(mapLoc, res)
}
-func (s *GovernanceState) ClearDKGFinalized(dkgSet map[coreTypes.NodeID]struct{}) {
+func (s *GovernanceState) ClearDKGFinalizeds(dkgSet map[coreTypes.NodeID]struct{}) {
for id := range dkgSet {
s.PutDKGFinalized(IdToAddress(id), false)
}
@@ -1203,9 +1203,9 @@ func (g *GovernanceContract) clearDKG() {
dkgSet := g.getDKGSet(g.evm.Round)
g.state.ClearDKGMasterPublicKeys()
g.state.ClearDKGComplaints()
- g.state.ClearDKGMPKReady(dkgSet)
+ g.state.ClearDKGMPKReadys(dkgSet)
g.state.ResetDKGMPKReadysCount()
- g.state.ClearDKGFinalized(dkgSet)
+ g.state.ClearDKGFinalizeds(dkgSet)
g.state.ResetDKGFinalizedsCount()
}
@@ -2041,7 +2041,7 @@ func (g *GovernanceContract) Run(evm *EVM, input []byte, contract *Contract) (re
return nil, errExecutionReverted
}
return res, nil
- case "dkgReadys":
+ case "dkgMPKReadys":
addr := common.Address{}
if err := method.Inputs.Unpack(&addr, arguments); err != nil {
return nil, errExecutionReverted
@@ -2052,7 +2052,7 @@ func (g *GovernanceContract) Run(evm *EVM, input []byte, contract *Contract) (re
return nil, errExecutionReverted
}
return res, nil
- case "dkgReadysCount":
+ case "dkgMPKReadysCount":
count := g.state.DKGMPKReadysCount()
res, err := method.Outputs.Pack(count)
if err != nil {
diff --git a/core/vm/oracle_contracts_test.go b/core/vm/oracle_contracts_test.go
index 6e2a7fc7f..16d8e8a92 100644
--- a/core/vm/oracle_contracts_test.go
+++ b/core/vm/oracle_contracts_test.go
@@ -910,9 +910,9 @@ func (g *OracleContractsTestSuite) TestResetDKG() {
dkgSet := dkgSets[round-1]
g.s.ClearDKGMasterPublicKeys()
g.s.ClearDKGComplaints()
- g.s.ClearDKGMPKReady(dkgSet)
+ g.s.ClearDKGMPKReadys(dkgSet)
g.s.ResetDKGMPKReadysCount()
- g.s.ClearDKGFinalized(dkgSet)
+ g.s.ClearDKGFinalizeds(dkgSet)
g.s.ResetDKGFinalizedsCount()
g.s.SetDKGRound(big.NewInt(int64(round)))
}