aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-11-02 12:42:04 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:17 +0800
commitfa4a62c777f38a5f03176405a53c3926fcb90a31 (patch)
tree71270816f4e41ee80f802ca2f2ed0f207bab0804 /core
parent248fdaa5ccca535ddce93173f2f0f3bc60b9381d (diff)
downloadgo-tangerine-fa4a62c777f38a5f03176405a53c3926fcb90a31.tar
go-tangerine-fa4a62c777f38a5f03176405a53c3926fcb90a31.tar.gz
go-tangerine-fa4a62c777f38a5f03176405a53c3926fcb90a31.tar.bz2
go-tangerine-fa4a62c777f38a5f03176405a53c3926fcb90a31.tar.lz
go-tangerine-fa4a62c777f38a5f03176405a53c3926fcb90a31.tar.xz
go-tangerine-fa4a62c777f38a5f03176405a53c3926fcb90a31.tar.zst
go-tangerine-fa4a62c777f38a5f03176405a53c3926fcb90a31.zip
core: vm: add nodesLengh method for reading nodeSet size
Diffstat (limited to 'core')
-rw-r--r--core/vm/governance.go20
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