diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-11-02 12:42:04 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:52 +0800 |
commit | 745d76dc5e0f913059e7f89d24f3837b51f8d812 (patch) | |
tree | 3dcee67cd644e9b17d1163123276a673929cbdac | |
parent | 8e367a13fe30a6a63880ef4d031b7f6c153cf5f0 (diff) | |
download | dexon-745d76dc5e0f913059e7f89d24f3837b51f8d812.tar dexon-745d76dc5e0f913059e7f89d24f3837b51f8d812.tar.gz dexon-745d76dc5e0f913059e7f89d24f3837b51f8d812.tar.bz2 dexon-745d76dc5e0f913059e7f89d24f3837b51f8d812.tar.lz dexon-745d76dc5e0f913059e7f89d24f3837b51f8d812.tar.xz dexon-745d76dc5e0f913059e7f89d24f3837b51f8d812.tar.zst dexon-745d76dc5e0f913059e7f89d24f3837b51f8d812.zip |
core: vm: add nodesLengh method for reading nodeSet size
-rw-r--r-- | core/vm/governance.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/vm/governance.go b/core/vm/governance.go index 6ab6f173e..e2948c25b 100644 --- a/core/vm/governance.go +++ b/core/vm/governance.go @@ -602,6 +602,20 @@ const abiJSON = ` "payable": false, "stateMutability": "nonpayable", "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "nodesLength", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" } ] ` @@ -680,6 +694,12 @@ func RunGovernanceContract(evm *EVM, input []byte, contract *Contract) ( return nil, errExecutionReverted } return g.addDKGFinalize(args.Round, args.Finalize) + case "nodesLength": + res, err := method.Outputs.Pack(g.state.NodesLength()) + if err != nil { + return nil, errExecutionReverted + } + return res, nil case "proposeCRS": args := struct { Round *big.Int |