One more in-place commit. Moved BtcWireProto to its own file, added some features
This commit is contained in:
83
spec/btc_wire_proto_spec.rb
Normal file
83
spec/btc_wire_proto_spec.rb
Normal file
@@ -0,0 +1,83 @@
|
||||
require 'spec_helper'
|
||||
require 'btc_wire_proto'
|
||||
|
||||
# Fixtures data. Taken from: https://en.bitcoin.it/wiki/Protocol_specification
|
||||
|
||||
SERVICE_MASK = "\x00\x00\x00\x01" # Sets NODE_NETWORK
|
||||
|
||||
|
||||
describe BtcWireProto do
|
||||
# Payload fragments
|
||||
describe ServicesMask do
|
||||
it "should have node_network set to false when its bit is 0" do
|
||||
s = BtcWireProto::ServicesMask::read("\x00\x00\x00\x00")
|
||||
s.node_network.should == false
|
||||
end
|
||||
end
|
||||
|
||||
describe NetAddr do
|
||||
end
|
||||
describe TimestampedNetAddr do
|
||||
end
|
||||
describe VarInt do
|
||||
end
|
||||
describe VarStr do
|
||||
end
|
||||
describe InventoryVector do
|
||||
end
|
||||
describe Sha256 do
|
||||
end
|
||||
describe TransactionIn do
|
||||
end
|
||||
describe TransactionOut do
|
||||
end
|
||||
describe BlockHeader do
|
||||
end
|
||||
|
||||
# Payloads
|
||||
|
||||
describe Version do
|
||||
end
|
||||
|
||||
describe AddrPre31402 do
|
||||
end
|
||||
|
||||
describe AddrFrom31402 do
|
||||
end
|
||||
|
||||
describe Inventory do
|
||||
end
|
||||
|
||||
describe BlockSpec do
|
||||
end
|
||||
|
||||
describe Transaction do
|
||||
end
|
||||
|
||||
describe Block do
|
||||
end
|
||||
|
||||
describe Headers do
|
||||
end
|
||||
|
||||
describe CheckOrder do
|
||||
end
|
||||
|
||||
describe SubmitOrder do
|
||||
end
|
||||
|
||||
describe Reply do
|
||||
end
|
||||
|
||||
describe Alert do
|
||||
end
|
||||
|
||||
|
||||
# Messages
|
||||
describe MessageHdr do
|
||||
end
|
||||
|
||||
describe Message do
|
||||
end
|
||||
|
||||
end
|
Reference in New Issue
Block a user