-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade IPLD-prime to latest #215
Conversation
upgrade IPLD prime to latest, with breaking changes to syntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All just suggestions, nothing blocking
LinkNodeBuilderChooser: chooser, | ||
Ctx: ctx, | ||
LinkLoader: loader, | ||
LinkTargetNodeStyleChooser: chooser, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: can this be a shortened at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File under: requests for @warpfork
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confess I hate this one too, but it does what it says on the tin. I haven't thought of a shorter name.
shared_testutil/mocknet.go
Outdated
Ds2 datastore.Batching | ||
DTStoredCounter1 *storedcounter.StoredCounter | ||
DTStoredCounter2 *storedcounter.StoredCounter | ||
StoredCounter1 *storedcounter.StoredCounter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be called DIDStoredCounter1 & 2 like the ones above? or DealStoredCounter1 &2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
shared_testutil/test_ipld_tree.go
Outdated
mb.Insert(knb.CreateString("nonlink"), vnb.CreateString("zoo")) | ||
})) | ||
middleMapNode, middleMapNodeLnk = encode(fluent.MustBuildMap(basicnode.Style.Map, 3, func(ma fluent.MapAssembler) { | ||
nva := ma.AssembleEntry("foo") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can actually chain these and cut your lines almost in half. I just made the changes and all the tests still pass:
nva := ma.AssembleEntry("foo") | |
ma.AssembleEntry("foo").AssignBool(true) | |
ma.AssembleEntry("bar").AssignBool(false) | |
ma.AssembleEntry("nested").CreateMap(2, func(ma fluent.MapAssembler) { | |
ma.AssembleEntry("alink").AssignLink(leafAlphaLnk) | |
ma.AssembleEntry("nonlink").AssignString("zoo") | |
}) | |
})) | |
middleMapBlock, _ = blocks.NewBlockWithCid(storage[middleMapNodeLnk], middleMapNodeLnk.(cidlink.Link).Cid) | |
middleListNode, middleListNodeLnk = encode(fluent.MustBuildList(basicnode.Style.List, 4, func(la fluent.ListAssembler) { | |
la.AssembleValue().AssignLink(leafAlphaLnk) | |
la.AssembleValue().AssignLink(leafAlphaLnk) | |
la.AssembleValue().AssignLink(leafBetaLnk) | |
la.AssembleValue().AssignLink(leafAlphaLnk) | |
})) | |
middleListBlock, _ = blocks.NewBlockWithCid(storage[middleListNodeLnk], middleListNodeLnk.(cidlink.Link).Cid) | |
rootNode, rootNodeLnk = encode(fluent.MustBuildMap(basicnode.Style.Map, 4, func(ma fluent.MapAssembler) { | |
ma.AssembleEntry("plain").AssignString("olde string") | |
ma.AssembleEntry("linkedString").AssignLink(leafAlphaLnk) | |
ma.AssembleEntry("linkedMap").AssignLink(middleMapNodeLnk) | |
ma.AssembleEntry("linkedList").AssignLink(middleListNodeLnk) | |
})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool! cc: @warpfork this makes for a wonderfully concise syntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh thank goodness
use conscise syntax for test tree and rename stored counters
Goals
Upgrade to go-ipld-prime & graphsync to latest
Implementation