Tests for verack

This commit is contained in:
Nick Thomas
2011-05-19 22:54:00 +01:00
parent dd2c02a206
commit c32960d0d5

View File

@@ -259,6 +259,24 @@ describe ::BtcWireProto do
end end
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
end end