aboutsummaryrefslogtreecommitdiffstats
path: root/core/test/state_test.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-11-08 15:58:51 +0800
committerGitHub <noreply@github.com>2018-11-08 15:58:51 +0800
commit1ee5863fd4a295d34c3a2d602d5603e8746e3f7b (patch)
tree044308b22000bb0c9f5a8c3c21f465159418db24 /core/test/state_test.go
parentdbe83ea4a324941417d6ff09230e5874d5ba5df5 (diff)
downloaddexon-consensus-1ee5863fd4a295d34c3a2d602d5603e8746e3f7b.tar
dexon-consensus-1ee5863fd4a295d34c3a2d602d5603e8746e3f7b.tar.gz
dexon-consensus-1ee5863fd4a295d34c3a2d602d5603e8746e3f7b.tar.bz2
dexon-consensus-1ee5863fd4a295d34c3a2d602d5603e8746e3f7b.tar.lz
dexon-consensus-1ee5863fd4a295d34c3a2d602d5603e8746e3f7b.tar.xz
dexon-consensus-1ee5863fd4a295d34c3a2d602d5603e8746e3f7b.tar.zst
dexon-consensus-1ee5863fd4a295d34c3a2d602d5603e8746e3f7b.zip
simulation: use test.Governacne in simulation (#311)
* Move simulation.Network to test package * Use test.Governance in simulation * Pack/Apply state request in blocks payload * Add Governance.SwitchToRemoteMode This would trigger governance to broadcast pending state change requests when changes. * Allow to marshal/unmarshal packedStateChanges * Attach test.Network and test.State
Diffstat (limited to 'core/test/state_test.go')
-rw-r--r--core/test/state_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/test/state_test.go b/core/test/state_test.go
index 6c5f882..864b5be 100644
--- a/core/test/state_test.go
+++ b/core/test/state_test.go
@@ -315,6 +315,9 @@ func (s *StateTestSuite) TestPacking() {
req.Empty(st.DKGMasterPublicKeys(2))
req.Empty(st.DKGComplaints(2))
req.False(st.IsDKGFinal(2, 0))
+ // In remote mode, we need to manually convert own requests to global ones.
+ _, err = st.PackOwnRequests()
+ req.NoError(err)
// Pack changes into bytes.
b, err := st.PackRequests()
req.NoError(err)