diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-01-24 15:05:24 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:56 +0800 |
commit | 87db7f44d06ff4610b7a7a0b3bc845b8d8e342d0 (patch) | |
tree | 7243672ff3235c5fc741b09e0cadf7c69a7c6ec8 /core/vm/governance_test.go | |
parent | 6f9f78e54ceb93db5495a3e15568efbfa9e5b25b (diff) | |
download | dexon-87db7f44d06ff4610b7a7a0b3bc845b8d8e342d0.tar.gz dexon-87db7f44d06ff4610b7a7a0b3bc845b8d8e342d0.tar.zst dexon-87db7f44d06ff4610b7a7a0b3bc845b8d8e342d0.zip |
consensus: dexcon: snapshot round height when finalizing block (#170)
Instead of having BP to send a tx to register the round height, just
modify the state when finalizing block.
Diffstat (limited to 'core/vm/governance_test.go')
-rw-r--r-- | core/vm/governance_test.go | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/core/vm/governance_test.go b/core/vm/governance_test.go index 879bb406e..292e4ef1d 100644 --- a/core/vm/governance_test.go +++ b/core/vm/governance_test.go @@ -625,46 +625,6 @@ func (g *GovernanceContractTestSuite) TestUpdateConfiguration() { g.Require().NoError(err) } -func (g *GovernanceContractTestSuite) TestSnapshotRound() { - _, addr := g.newPrefundAccount() - - // Wrong height. - input, err := abiObject.Pack("snapshotRound", big.NewInt(1), big.NewInt(666)) - g.Require().NoError(err) - _, err = g.call(addr, input, big.NewInt(0)) - g.Require().NotNil(err) - - // Invalid round. - input, err = abiObject.Pack("snapshotRound", big.NewInt(2), big.NewInt(2000)) - g.Require().NoError(err) - _, err = g.call(addr, input, big.NewInt(0)) - g.Require().NotNil(err) - - // Correct. - input, err = abiObject.Pack("snapshotRound", big.NewInt(1), big.NewInt(1000)) - g.Require().NoError(err) - _, err = g.call(addr, input, big.NewInt(0)) - g.Require().NoError(err) - - // Duplicate round. - input, err = abiObject.Pack("snapshotRound", big.NewInt(1), big.NewInt(1000)) - g.Require().NoError(err) - _, err = g.call(addr, input, big.NewInt(0)) - g.Require().NotNil(err) - - // Invalid round. - input, err = abiObject.Pack("snapshotRound", big.NewInt(3), big.NewInt(3000)) - g.Require().NoError(err) - _, err = g.call(addr, input, big.NewInt(0)) - g.Require().NotNil(err) - - // Correct. - input, err = abiObject.Pack("snapshotRound", big.NewInt(2), big.NewInt(2000)) - g.Require().NoError(err) - _, err = g.call(addr, input, big.NewInt(0)) - g.Require().NoError(err) -} - func (g *GovernanceContractTestSuite) TestConfigurationReading() { _, addr := g.newPrefundAccount() |