diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-12-31 23:28:54 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:20 +0800 |
commit | 12876a86ac3dadd89831c2b02bf9be6fced9e24b (patch) | |
tree | 2c2468968973ffb0098e2b8f617ec79d22c42be4 /core/vm/governance_test.go | |
parent | 59e8802f35e6ccdc23c8cfce548eb6c81dd0dc55 (diff) | |
download | go-tangerine-12876a86ac3dadd89831c2b02bf9be6fced9e24b.tar go-tangerine-12876a86ac3dadd89831c2b02bf9be6fced9e24b.tar.gz go-tangerine-12876a86ac3dadd89831c2b02bf9be6fced9e24b.tar.bz2 go-tangerine-12876a86ac3dadd89831c2b02bf9be6fced9e24b.tar.lz go-tangerine-12876a86ac3dadd89831c2b02bf9be6fced9e24b.tar.xz go-tangerine-12876a86ac3dadd89831c2b02bf9be6fced9e24b.tar.zst go-tangerine-12876a86ac3dadd89831c2b02bf9be6fced9e24b.zip |
core: vm: add missing unittests for nodes/delegators (#116)
Diffstat (limited to 'core/vm/governance_test.go')
-rw-r--r-- | core/vm/governance_test.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/vm/governance_test.go b/core/vm/governance_test.go index ee9ae751f..a91aba7b6 100644 --- a/core/vm/governance_test.go +++ b/core/vm/governance_test.go @@ -755,10 +755,15 @@ func (g *GovernanceContractTestSuite) TestMiscVariableReading() { _, err = g.call(addrDelegator2, input, amount) g.Require().NoError(err) - input, err = abiObject.Pack("nodesLength") + input, err = abiObject.Pack("nodes", big.NewInt(0)) g.Require().NoError(err) res, err := g.call(addr, input, big.NewInt(0)) g.Require().NoError(err) + + input, err = abiObject.Pack("nodesLength") + g.Require().NoError(err) + res, err = g.call(addr, input, big.NewInt(0)) + g.Require().NoError(err) var value *big.Int err = abiObject.Unpack(&value, "nodesLength", res) g.Require().NoError(err) @@ -772,6 +777,11 @@ func (g *GovernanceContractTestSuite) TestMiscVariableReading() { g.Require().NoError(err) g.Require().Equal(0, int(value.Uint64())) + input, err = abiObject.Pack("delegators", addr, big.NewInt(0)) + g.Require().NoError(err) + res, err = g.call(addr, input, big.NewInt(0)) + g.Require().NoError(err) + input, err = abiObject.Pack("delegatorsLength", addr) g.Require().NoError(err) res, err = g.call(addr, input, big.NewInt(0)) |