Skip to content
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

Merged
merged 2 commits into from
Apr 30, 2020
Merged

Conversation

hannahhoward
Copy link
Collaborator

Goals

Upgrade to go-ipld-prime & graphsync to latest

Implementation

  • various rename to fit new node assembler syntax
  • largely no other substantive changes

upgrade IPLD prime to latest, with breaking changes to syntax
Copy link
Contributor

@shannonwells shannonwells left a 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,
Copy link
Contributor

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?

Copy link
Collaborator Author

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

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.

Ds2 datastore.Batching
DTStoredCounter1 *storedcounter.StoredCounter
DTStoredCounter2 *storedcounter.StoredCounter
StoredCounter1 *storedcounter.StoredCounter
Copy link
Contributor

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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")
Copy link
Contributor

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:

Suggested change
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)
}))

Copy link
Collaborator Author

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

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
@hannahhoward hannahhoward merged commit c7fc596 into hotfix/0.1.2 Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants