Tests for verack
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user