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
// An IPFS MerkleDAG Link
message PBLink {
// multihash of the target object
optional bytes Hash = 1;
// utf string name. should be unique per object
optional string Name = 2;
// cumulative size of target object
optional uint64 Tsize = 3;
}
// An IPFS MerkleDAG Node
message PBNode {
// refs to other objects
repeated PBLink Links = 2;
// opaque user data
optional bytes Data = 1;
}
I would expect that Links is written before Data, but looking at the generated source code it is the other way around
if(message.Data!=null&&message.hasOwnProperty("Data"))writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.Data);if(message.Links!=null&&message.Links.length)for(vari=0;i<message.Links.length;++i)$root.PBLink.encode(message.Links[i],writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
As I am doing hash comparisons between serialised objects, this breaks quite a lot of things for me currently.
Given a proto definition like this
I would expect that
Links
is written beforeData
, but looking at the generated source code it is the other way aroundAs I am doing hash comparisons between serialised objects, this breaks quite a lot of things for me currently.
(Full source: https://github.com/ipld/js-ipld-dag-pb/tree/master/src)
The text was updated successfully, but these errors were encountered: