diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-12-07 18:02:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-07 18:02:59 +0800 |
commit | 1b352d9e52839c8b6c316c2601d08c91c995d8f0 (patch) | |
tree | 32aff3397d61b0e6f5e2d6f407ec5ab3a69311d8 /core/test | |
parent | a63e0d313300fc85eba8254963800a312fb14e9b (diff) | |
download | dexon-consensus-1b352d9e52839c8b6c316c2601d08c91c995d8f0.tar dexon-consensus-1b352d9e52839c8b6c316c2601d08c91c995d8f0.tar.gz dexon-consensus-1b352d9e52839c8b6c316c2601d08c91c995d8f0.tar.bz2 dexon-consensus-1b352d9e52839c8b6c316c2601d08c91c995d8f0.tar.lz dexon-consensus-1b352d9e52839c8b6c316c2601d08c91c995d8f0.tar.xz dexon-consensus-1b352d9e52839c8b6c316c2601d08c91c995d8f0.tar.zst dexon-consensus-1b352d9e52839c8b6c316c2601d08c91c995d8f0.zip |
core: fix bugs found when node-set is not equal to notary-set (#362)
Diffstat (limited to 'core/test')
-rw-r--r-- | core/test/state-change-request.go | 8 | ||||
-rw-r--r-- | core/test/state.go | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/core/test/state-change-request.go b/core/test/state-change-request.go index 84d4d3f..1515fd2 100644 --- a/core/test/state-change-request.go +++ b/core/test/state-change-request.go @@ -185,7 +185,11 @@ func (req *StateChangeRequest) String() (ret string) { ret += fmt.Sprintf( "{Type:AddNode %s", types.NewNodeID(req.Payload.(crypto.PublicKey)).String()[:6]) + default: + panic(fmt.Errorf( + "attempting to dump unknown type of state change request: %v", + req.Type)) } - panic(fmt.Errorf( - "attempting to dump unknown type of state change request: %v", req.Type)) + ret += "}" + return } diff --git a/core/test/state.go b/core/test/state.go index b360fa2..30ed8af 100644 --- a/core/test/state.go +++ b/core/test/state.go @@ -177,6 +177,11 @@ func (s *State) Snapshot() (*types.Config, []crypto.PublicKey) { }, nodes } +// AttachLogger allows to attach custom logger. +func (s *State) AttachLogger(logger common.Logger) { + s.logger = logger +} + func (s *State) unpackPayload( raw *rawStateChangeRequest) (v interface{}, err error) { switch raw.Type { |