@@ -26,7 +26,7 @@ func TestAppendingRequests(t *testing.T) {
26
26
root := testutil .GenerateCids (1 )[0 ]
27
27
ssb := builder .NewSelectorSpecBuilder (basicnode .Prototype .Any )
28
28
selector := ssb .Matcher ().Node ()
29
- id := graphsync .RequestID ( rand . Int31 () )
29
+ id := graphsync .NewRequestID ( )
30
30
priority := graphsync .Priority (rand .Int31 ())
31
31
32
32
builder := NewBuilder (Topic (0 ))
@@ -51,7 +51,7 @@ func TestAppendingRequests(t *testing.T) {
51
51
require .NoError (t , err )
52
52
53
53
pbRequest := pbMessage .Requests [0 ]
54
- require .Equal (t , int32 ( id ) , pbRequest .Id )
54
+ require .Equal (t , id [:] , pbRequest .Id )
55
55
require .Equal (t , int32 (priority ), pbRequest .Priority )
56
56
require .False (t , pbRequest .Cancel )
57
57
require .False (t , pbRequest .Update )
@@ -82,7 +82,7 @@ func TestAppendingResponses(t *testing.T) {
82
82
Name : extensionName ,
83
83
Data : testutil .RandomBytes (100 ),
84
84
}
85
- requestID := graphsync .RequestID ( rand . Int31 () )
85
+ requestID := graphsync .NewRequestID ( )
86
86
status := graphsync .RequestAcknowledged
87
87
88
88
builder := NewBuilder (Topic (0 ))
@@ -102,7 +102,7 @@ func TestAppendingResponses(t *testing.T) {
102
102
pbMessage , err := gsm .ToProto ()
103
103
require .NoError (t , err , "serialize to protobuf errored" )
104
104
pbResponse := pbMessage .Responses [0 ]
105
- require .Equal (t , int32 ( requestID ) , pbResponse .Id )
105
+ require .Equal (t , requestID [:] , pbResponse .Id )
106
106
require .Equal (t , int32 (status ), pbResponse .Status )
107
107
require .Equal (t , extension .Data , pbResponse .Extensions ["graphsync/awesome" ])
108
108
@@ -154,7 +154,7 @@ func contains(strs []string, x string) bool {
154
154
func TestRequestCancel (t * testing.T ) {
155
155
ssb := builder .NewSelectorSpecBuilder (basicnode .Prototype .Any )
156
156
selector := ssb .Matcher ().Node ()
157
- id := graphsync .RequestID ( rand . Int31 () )
157
+ id := graphsync .NewRequestID ( )
158
158
priority := graphsync .Priority (rand .Int31 ())
159
159
root := testutil .GenerateCids (1 )[0 ]
160
160
@@ -184,7 +184,7 @@ func TestRequestCancel(t *testing.T) {
184
184
185
185
func TestRequestUpdate (t * testing.T ) {
186
186
187
- id := graphsync .RequestID ( rand . Int31 () )
187
+ id := graphsync .NewRequestID ( )
188
188
extensionName := graphsync .ExtensionName ("graphsync/awesome" )
189
189
extension := graphsync.ExtensionData {
190
190
Name : extensionName ,
@@ -235,7 +235,7 @@ func TestToNetFromNetEquivalency(t *testing.T) {
235
235
Name : extensionName ,
236
236
Data : testutil .RandomBytes (100 ),
237
237
}
238
- id := graphsync .RequestID ( rand . Int31 () )
238
+ id := graphsync .NewRequestID ( )
239
239
priority := graphsync .Priority (rand .Int31 ())
240
240
status := graphsync .RequestAcknowledged
241
241
@@ -325,7 +325,7 @@ func TestMergeExtensions(t *testing.T) {
325
325
root := testutil .GenerateCids (1 )[0 ]
326
326
ssb := builder .NewSelectorSpecBuilder (basicnode .Prototype .Any )
327
327
selector := ssb .Matcher ().Node ()
328
- id := graphsync .RequestID ( rand . Int31 () )
328
+ id := graphsync .NewRequestID ( )
329
329
priority := graphsync .Priority (rand .Int31 ())
330
330
defaultRequest := NewRequest (id , root , selector , priority , initialExtensions ... )
331
331
t .Run ("when merging into empty" , func (t * testing.T ) {
0 commit comments