From e473fd6eb8b63eb26c64ab86218d3cab028ecdb4 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Thu, 9 May 2013 00:01:29 -0500 Subject: [PATCH] Add message tests for MsgAlert and MsgMemPool. --- message.go | 6 ++++++ message_test.go | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/message.go b/message.go index dea9668b..9482f95c 100644 --- a/message.go +++ b/message.go @@ -97,6 +97,12 @@ func makeEmptyMessage(command string) (Message, error) { case cmdHeaders: msg = &MsgHeaders{} + case cmdAlert: + msg = &MsgAlert{} + + case cmdMemPool: + msg = &MsgMemPool{} + default: return nil, fmt.Errorf("unhandled command [%s]", command) } diff --git a/message_test.go b/message_test.go index 27756e9e..d3f0b8c0 100644 --- a/message_test.go +++ b/message_test.go @@ -48,6 +48,8 @@ func TestMessage(t *testing.T) { msgPong := btcwire.NewMsgPong(123123) msgGetHeaders := btcwire.NewMsgGetHeaders() msgHeaders := btcwire.NewMsgHeaders() + msgAlert := btcwire.NewMsgAlert("payload", "signature") + msgMemPool := btcwire.NewMsgMemPool() tests := []struct { in btcwire.Message // Value to encode @@ -69,6 +71,8 @@ func TestMessage(t *testing.T) { {msgPong, msgPong, pver, btcwire.MainNet}, {msgGetHeaders, msgGetHeaders, pver, btcwire.MainNet}, {msgHeaders, msgHeaders, pver, btcwire.MainNet}, + {msgAlert, msgAlert, pver, btcwire.MainNet}, + {msgMemPool, msgMemPool, pver, btcwire.MainNet}, } t.Logf("Running %d tests", len(tests))