Open liamsi opened 6 years ago
add a test case that fails before #180 was merged (and check for general test-coverage while at it):
cdc.RegisterInterface((*Packet)(nil), nil) cdc.RegisterConcrete(PacketPing{}, "tendermint/p2p/PacketPing", nil) cdc.RegisterConcrete(PacketPong{}, "tendermint/p2p/PacketPong", nil) buf := bytes.NewBuffer(nil) buf.Write(cdc.MustMarshalBinary(PacketPing{})) fmt.Printf("%X", buf.Bytes()) var pkt PacketPing _, err = cdc.UnmarshalBinaryReader(buf, &pkt, 1024) assert.NoError(t, err)
Above should do the job.
add a test case that fails before #180 was merged (and check for general test-coverage while at it):
Above should do the job.