diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/vm/oracle_contracts.go | 8 | ||||
-rw-r--r-- | core/vm/oracle_contracts_test.go | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/core/vm/oracle_contracts.go b/core/vm/oracle_contracts.go index 37e734a5f..d983cdfc8 100644 --- a/core/vm/oracle_contracts.go +++ b/core/vm/oracle_contracts.go @@ -95,7 +95,7 @@ func publicKeyToNodeKeyAddress(pkBytes []byte) (common.Address, error) { return crypto.PubkeyToAddress(*pk), nil } -func idToAddress(id coreTypes.NodeID) common.Address { +func IdToAddress(id coreTypes.NodeID) common.Address { return common.BytesToAddress(id.Hash[12:]) } @@ -517,7 +517,7 @@ func (s *GovernanceState) DeleteNodeOffsets(n *nodeInfo) error { } func (s *GovernanceState) GetNodeByID(id coreTypes.NodeID) (*nodeInfo, error) { - offset := s.NodesOffsetByNodeKeyAddress(idToAddress(id)) + offset := s.NodesOffsetByNodeKeyAddress(IdToAddress(id)) if offset.Cmp(big.NewInt(0)) < 0 { return nil, errors.New("node not found") } @@ -630,7 +630,7 @@ func (s *GovernanceState) PutDKGMPKReady(addr common.Address, ready bool) { } func (s *GovernanceState) ClearDKGMPKReady(dkgSet map[coreTypes.NodeID]struct{}) { for id := range dkgSet { - s.PutDKGMPKReady(idToAddress(id), false) + s.PutDKGMPKReady(IdToAddress(id), false) } } @@ -661,7 +661,7 @@ func (s *GovernanceState) PutDKGFinalized(addr common.Address, finalized bool) { } func (s *GovernanceState) ClearDKGFinalized(dkgSet map[coreTypes.NodeID]struct{}) { for id := range dkgSet { - s.PutDKGFinalized(idToAddress(id), false) + s.PutDKGFinalized(IdToAddress(id), false) } } diff --git a/core/vm/oracle_contracts_test.go b/core/vm/oracle_contracts_test.go index 4539f0864..6e2a7fc7f 100644 --- a/core/vm/oracle_contracts_test.go +++ b/core/vm/oracle_contracts_test.go @@ -933,7 +933,7 @@ func (g *OracleContractsTestSuite) TestResetDKG() { dkgSets[round] = dkgSet for id := range dkgSet { - offset := g.s.NodesOffsetByNodeKeyAddress(idToAddress(id)) + offset := g.s.NodesOffsetByNodeKeyAddress(IdToAddress(id)) if offset.Cmp(big.NewInt(0)) < 0 { panic("DKG node does not exist") } |