diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-12-26 10:15:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-26 10:15:51 +0800 |
commit | d333dc1a24df26ae8e8e3ffa2d700c1116a93ba2 (patch) | |
tree | f615cfa34cca680dd3e4a5930e06a6ff03ac1664 /simulation/marshaller.go | |
parent | dce509a13ef5873b9cae3c1cabdb97e219b6fb7d (diff) | |
download | dexon-consensus-d333dc1a24df26ae8e8e3ffa2d700c1116a93ba2.tar dexon-consensus-d333dc1a24df26ae8e8e3ffa2d700c1116a93ba2.tar.gz dexon-consensus-d333dc1a24df26ae8e8e3ffa2d700c1116a93ba2.tar.bz2 dexon-consensus-d333dc1a24df26ae8e8e3ffa2d700c1116a93ba2.tar.lz dexon-consensus-d333dc1a24df26ae8e8e3ffa2d700c1116a93ba2.tar.xz dexon-consensus-d333dc1a24df26ae8e8e3ffa2d700c1116a93ba2.tar.zst dexon-consensus-d333dc1a24df26ae8e8e3ffa2d700c1116a93ba2.zip |
simulation: support config change (#381)
Diffstat (limited to 'simulation/marshaller.go')
-rw-r--r-- | simulation/marshaller.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/simulation/marshaller.go b/simulation/marshaller.go index 86eab3e..6f8aee4 100644 --- a/simulation/marshaller.go +++ b/simulation/marshaller.go @@ -30,12 +30,12 @@ type jsonMarshaller struct{} func (m *jsonMarshaller) Unmarshal( msgType string, payload []byte) (msg interface{}, err error) { switch msgType { - case "info-status": - var status infoStatus - if err = json.Unmarshal(payload, &status); err != nil { + case "server-notif": + var notif serverNotification + if err = json.Unmarshal(payload, ¬if); err != nil { break } - msg = status + msg = notif case "blocklist": var blocks BlockList if err = json.Unmarshal(payload, &blocks); err != nil { @@ -61,8 +61,8 @@ func (m *jsonMarshaller) Unmarshal( func (m *jsonMarshaller) Marshal(msg interface{}) ( msgType string, payload []byte, err error) { switch msg.(type) { - case infoStatus: - msgType = "info-status" + case serverNotification: + msgType = "server-notif" case *BlockList: msgType = "blocklist" case *message: |