Browse Source

pass tests!

pull/703/head
Zach Ramsay 7 years ago
committed by Ethan Buchman
parent
commit
414a8cb0ba
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      types/heartbeat_test.go

+ 3
- 3
types/heartbeat_test.go View File

@ -40,17 +40,17 @@ func TestHeartbeatWriteSignBytes(t *testing.T) {
hb := &Heartbeat{ValidatorIndex: 1, Height: 10, Round: 1}
hb.WriteSignBytes("0xdeadbeef", buf, &n, &err)
require.Equal(t, string(buf.Bytes()), `{"chain_id":"0xdeadbeef","heartbeat":{"height":10,"round":1,"sequence":0,"validator_address":"","validator_index":1}}`)
require.Equal(t, buf.String(), `{"chain_id":"0xdeadbeef","heartbeat":{"height":10,"round":1,"sequence":0,"validator_address":"","validator_index":1}}`)
buf.Reset()
plainHb := &Heartbeat{}
plainHb.WriteSignBytes("0xdeadbeef", buf, &n, &err)
require.Equal(t, string(buf.Bytes()), `{"chain_id":"0xdeadbeef","heartbeat":{"height":0,"round":0,"sequence":0,"validator_address":"","validator_index":0}}`)
require.Equal(t, buf.String(), `{"chain_id":"0xdeadbeef","heartbeat":{"height":0,"round":0,"sequence":0,"validator_address":"","validator_index":0}}`)
require.Panics(t, func() {
buf.Reset()
var nilHb *Heartbeat
nilHb.WriteSignBytes("0xdeadbeef", buf, &n, &err)
require.Equal(t, string(buf.Bytes()), "null")
require.Equal(t, buf.String(), "null")
})
}

Loading…
Cancel
Save