-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Refactor EnumerateChildren to avoid need for bestEffort paramater. #3700
Conversation
WIP. A test is failing locally for me and I want to see if it okay on the build servers. |
d5e4a40
to
5bbe4a4
Compare
@whyrusleeping okay the tests are passing. Let me know if you are like this approach. If you do I will refactor the Async version in a similar fashion. |
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.
@kevina this seems like a very reasonable refactor. Lets make sure not to change the function parameter ordering. the new function parameter should take the place of the linkservice
I only did that because I thought the new order made more sense. Is there a reason you don't like it? Just curious. I have no problem changing them back. |
@kevina Eh, I think it makes more sense to have the fetcher first, as its almost as if the cid could be an argument to a method on the 'fetcher function'. |
Okay, will keep the order the same. Will also see what I can do to refactor the Async version, although that will be a little more involved. |
5bbe4a4
to
d7af05d
Compare
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.
Code LGTM, pointed out a few typos
merkledag/merkledag.go
Outdated
// calling Get in DAGService | ||
// Return all links for a node. The complete node does not | ||
// necessarily have to exist locally, or at all. For example, raw | ||
// leaves can not possible have links so there is no need to look |
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.
typo: cannot possibly
merkledag/merkledag.go
Outdated
@@ -114,6 +116,8 @@ func decodeBlock(b blocks.Block) (node.Node, error) { | |||
} | |||
} | |||
|
|||
// GetLinks return the links for the node, the node doesn't necessary |
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.
typo: necessarily
merkledag/merkledag.go
Outdated
@@ -138,9 +142,22 @@ func (n *dagService) Remove(nd node.Node) error { | |||
return n.Blocks.DeleteBlock(nd) | |||
} | |||
|
|||
// Create a functtion to get the links for a node, from the node, |
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.
typo: function, guaranteed
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.
Also go style of docs says that you should start doc comment with the name of the function.
daf983d
to
f778076
Compare
@Kubuxu I fixed my comments to include the start with the name of the function @whyrusleeping I corrected the typos you pointed out. |
Alright cool, this is ready to go in 0.4.7 |
@kevina got a merge conflict here. Mind rebasing? |
License: MIT Signed-off-by: Kevin Atkinson <[email protected]>
For now it is always called with the helper function GetLinksDirect to avoid any change in behaviour. License: MIT Signed-off-by: Kevin Atkinson <[email protected]>
License: MIT Signed-off-by: Kevin Atkinson <[email protected]>
9d57601
to
e4bbd24
Compare
@whyrusleeping sorry, missed this. Just rebased and things should be good to go. |
Thanks @kevina ! |
License: MIT
Signed-off-by: Kevin Atkinson [email protected]