From 1ee5863fd4a295d34c3a2d602d5603e8746e3f7b Mon Sep 17 00:00:00 2001 From: Mission Liao Date: Thu, 8 Nov 2018 15:58:51 +0800 Subject: 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 --- core/test/state_test.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/test/state_test.go') 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) -- cgit v1.2.3