diff --git a/spec/btc_wire_proto_spec.rb b/spec/btc_wire_proto_spec.rb index c22997d..ca4b6ff 100644 --- a/spec/btc_wire_proto_spec.rb +++ b/spec/btc_wire_proto_spec.rb @@ -259,6 +259,24 @@ describe ::BtcWireProto do end end + + context "Verack message" do + it "should have no payload" do + m = Message.new(:header => {:command => "verack"}) + m.payload.selection.should == "null" + end + + it "should parse the binary data correctly" do + m = Message::read(binary(%w{ + F9 BE B4 D9 76 65 72 61 63 6B 00 00 00 00 00 00 00 00 00 00 + })) + m.header.magic.should == BtcWireProto::NETWORKS[:main] + m.header.command.should == "verack\x00\x00\x00\x00\x00\x00" + m.header.payload_len.should == 0 + m.header.has_parameter?(:chcksum).should be_false + end + + end end end