You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1) add PeerID to datasetRef
2) adjust all functions that compare datasetRefs to match
3) Alter CanonicalizePeername to CanonicalizePeer (doesn’t just
canonicalize Peername, also matched PeerID and Peername)
4) Fix any spots that use CanonicalizePeername to now use
CanonicalizePeer
5) Add CanonicalizePeer tests
6) fix any tests that change now that we have PeerID in the mix!
"description": "Paper samples, paper extracts (known), paper extracts (unknown). \n\nThis dataset is associated with the following publication:\nSchaider, L., S. Balan, A. Blum, D. Andrews, M. Strynar, M. Dickinson, D. Lunderberg, J. Lang, and G. Peaslee. Fluorinated Compounds in U.S. Fast Food Packaging. Environmental Science \u0026amp; Technology Letters. American Chemical Society, Washington, DC, USA, 4(3): 105\u0026ndash;111, (2017).",
24038
-
"qri": "md:0",
24039
-
"title": "Fluorinated Compounds in U.S. Fast Food Packaging"
returnfmt.Errorf("Peername and PeerID combination not valid: Peername = %s, PeerID = %s, but was given PeerID = %s", p.Peername, p.ID, ref.PeerID)
286
+
}
287
+
ifref.PeerID==p.ID&&ref.Peername!=p.Peername {
288
+
returnfmt.Errorf("Peername and PeerID combination not valid: PeerID = %s, Peername = %s, but was given Peername = %s", p.ID, p.Peername, ref.Peername)
289
+
}
290
+
ifref.Peername==p.Peername&&ref.PeerID==p.ID {
291
+
returnnil
292
+
}
293
+
}
294
+
295
+
ifref.Peername!="" {
296
+
ifref.Peername!=p.Peername {
297
+
returnnil
298
+
}
299
+
}
300
+
301
+
ifref.PeerID!="" {
302
+
ifref.PeerID!=p.ID {
303
+
returnnil
304
+
}
305
+
}
306
+
307
+
ref.Peername=p.Peername
308
+
ref.PeerID=p.ID
309
+
returnnil
310
+
}
311
+
ifref.PeerID!="" {
312
+
pid, err:=profile.NewB58PeerID(ref.PeerID)
255
313
iferr!=nil {
256
-
returnerr
314
+
returnfmt.Errorf("error converting PeerID to base58 hash: %s", err)
315
+
}
316
+
317
+
peer, err:=r.Peers().GetPeer(pid)
318
+
iferr!=nil {
319
+
returnfmt.Errorf("error fetching peers from store: %s", err)
320
+
}
321
+
322
+
ifref.Peername=="" {
323
+
ref.Peername=peer.Peername
324
+
returnnil
325
+
}
326
+
ifref.Peername!=peer.Peername {
327
+
returnfmt.Errorf("Peername and PeerID combination not valid: PeerID = %s, Peername = %s, but was given Peername = %s", peer.ID, peer.Peername, ref.Peername)
328
+
}
329
+
}
330
+
ifref.Peername!="" {
331
+
id, err:=r.Peers().GetID(ref.Peername)
332
+
iferr!=nil {
333
+
returnfmt.Errorf("error fetching peers from store: %s", err)
334
+
}
335
+
ifref.PeerID=="" {
336
+
ref.PeerID=id.String()
337
+
returnnil
338
+
}
339
+
ifref.PeerID!=id.String() {
340
+
returnfmt.Errorf("Peername and PeerID combination not valid: Peername = %s, PeerID = %s, but was given PeerID = %s", ref.Peername, id.String(), ref.PeerID)
257
341
}
258
-
*peername=p.Peername
259
342
}
260
343
returnnil
261
344
}
262
345
263
346
// CompareDatasetRef compares two Dataset References, returning an error
264
347
// describing any difference between the two references
0 commit comments