diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-03-06 14:32:06 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:57 +0800 |
commit | 2cc2ac2e771daa7598ca8dd80722a847bdc2749a (patch) | |
tree | 28ace5e2beb4b398a93b7cfd381b50c521cb02b6 /core | |
parent | 9bb967aa96facf62765762dd17bedb9cb6c69c79 (diff) | |
download | dexon-2cc2ac2e771daa7598ca8dd80722a847bdc2749a.tar.gz dexon-2cc2ac2e771daa7598ca8dd80722a847bdc2749a.tar.zst dexon-2cc2ac2e771daa7598ca8dd80722a847bdc2749a.zip |
dex: fill in correct coinbase address (#223)
Also remove app_test.go because of the refactor bojie@ is working on.
Diffstat (limited to 'core')
-rw-r--r-- | core/vm/oracle_contracts.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/vm/oracle_contracts.go b/core/vm/oracle_contracts.go index 1ebf3f1d4..cf060e9ac 100644 --- a/core/vm/oracle_contracts.go +++ b/core/vm/oracle_contracts.go @@ -488,6 +488,15 @@ func (s *GovernanceState) PutNodeOffsets(n *nodeInfo, offset *big.Int) error { return nil } +func (s *GovernanceState) GetNodeOwnerByID(id coreTypes.NodeID) (common.Address, error) { + offset := s.NodesOffsetByNodeKeyAddress(idToAddress(id)) + if offset.Cmp(big.NewInt(0)) < 0 { + return common.Address{}, errors.New("node not found") + } + node := s.Node(offset) + return node.Owner, nil +} + // struct Delegator { // address node; // address owner; |