mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 01:13:45 +00:00
swarm/network: HandoverProof should not be nil
This commit is contained in:
parent
40cfae13ef
commit
d075df7159
2 changed files with 16 additions and 11 deletions
|
|
@ -82,11 +82,11 @@ type SubscribeMsg struct {
|
|||
// OfferedHashesMsg is the protocol msg for offering to hand over a
|
||||
// stream section
|
||||
type OfferedHashesMsg struct {
|
||||
Stream string // name of Stream
|
||||
Key []byte // subtype or key
|
||||
From, To uint64 // peer and db-specific entry count
|
||||
Hashes []byte // stream of hashes (128)
|
||||
*HandoverProof `rlp:"nil"` // HandoverProof
|
||||
Stream string // name of Stream
|
||||
Key []byte // subtype or key
|
||||
From, To uint64 // peer and db-specific entry count
|
||||
Hashes []byte // stream of hashes (128)
|
||||
*HandoverProof // HandoverProof
|
||||
}
|
||||
|
||||
// String pretty prints OfferedHashesMsg
|
||||
|
|
|
|||
|
|
@ -136,7 +136,10 @@ func (self *testIncomingStreamer) BatchDone(string, uint64, []byte, []byte) func
|
|||
}
|
||||
|
||||
func (self *testOutgoingStreamer) SetNextBatch(from uint64, to uint64) ([]byte, uint64, uint64, *HandoverProof, error) {
|
||||
return make([]byte, HashSize), from + 1, to + 1, nil, nil
|
||||
proof := &HandoverProof{
|
||||
Handover: &Handover{},
|
||||
}
|
||||
return make([]byte, HashSize), from + 1, to + 1, proof, nil
|
||||
}
|
||||
|
||||
func (self *testOutgoingStreamer) GetData([]byte) []byte {
|
||||
|
|
@ -221,11 +224,13 @@ func TestStreamerUpstreamSubscribeMsgExchange(t *testing.T) {
|
|||
p2ptest.Expect{
|
||||
Code: 1,
|
||||
Msg: &OfferedHashesMsg{
|
||||
Stream: "foo",
|
||||
HandoverProof: nil,
|
||||
Hashes: make([]byte, HashSize),
|
||||
From: 6,
|
||||
To: 9,
|
||||
Stream: "foo",
|
||||
HandoverProof: &HandoverProof{
|
||||
Handover: &Handover{},
|
||||
},
|
||||
Hashes: make([]byte, HashSize),
|
||||
From: 6,
|
||||
To: 9,
|
||||
},
|
||||
Peer: peerID,
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue