File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 5
5
module . exports = `
6
6
message Message {
7
7
message Wantlist {
8
+ enum WantType {
9
+ Block = 0;
10
+ Have = 1;
11
+ }
12
+
8
13
message Entry {
9
14
// changed from string to bytes, it makes a difference in JavaScript
10
15
optional bytes block = 1; // the block cid (cidV0 in bitswap 1.0.0, cidV1 in bitswap 1.1.0)
11
16
optional int32 priority = 2; // the priority (normalized). default to 1
12
17
optional bool cancel = 3; // whether this revokes an entry
18
+ WantType want_type = 4; // Note: defaults to enum 0, ie Block
19
+ bool send_dont_have = 5; // Note: defaults to false
13
20
}
14
21
15
22
repeated Entry entries = 1; // a list of wantlist entries
@@ -21,8 +28,19 @@ module.exports = `
21
28
optional bytes data = 2;
22
29
}
23
30
31
+ enum BlockPresenceType {
32
+ Have = 0;
33
+ DontHave = 1;
34
+ }
35
+ message BlockPresence {
36
+ bytes cid = 1;
37
+ BlockPresenceType type = 2;
38
+ }
39
+
24
40
optional Wantlist wantlist = 1;
25
41
repeated bytes blocks = 2; // used to send Blocks in bitswap 1.0.0
26
42
repeated Block payload = 3; // used to send Blocks in bitswap 1.1.0
43
+ repeated BlockPresence blockPresences = 4;
44
+ int32 PendingBytes = 5;
27
45
}
28
46
`
Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ describe('BitswapMessage', () => {
35
35
expect ( pbm . Message . decode ( serialized ) . wantlist . entries [ 0 ] ) . to . be . eql ( {
36
36
block : cid . buffer ,
37
37
priority : 1 ,
38
- cancel : false
38
+ cancel : false ,
39
+ send_dont_have : false ,
40
+ want_type : pbm . Message . Wantlist . WantType . Block
39
41
} )
40
42
} )
41
43
You can’t perform that action at this time.
0 commit comments