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

WIP: add PeerID lookup #3882

Merged
merged 3 commits into from
May 25, 2017
Merged

Conversation

keremgocen
Copy link
Contributor

@keremgocen keremgocen commented Apr 27, 2017

  • enhance key lookup logic and enable PeerID lookup in addition to the key name
  • write sharness tests

as discussed in #3807

License: MIT
Signed-off-by: Kerem Gocen keremgocen@gmail.com

enhance key lookup logic and enable PeerID lookup in addition to the
key name

License: MIT
Signed-off-by: Kerem Gocen <keremgocen@gmail.com>
func keylookup(k string, n *core.IpfsNode) (crypto.PrivKey, error) {

res, err := n.GetKey(k)
if res != nil {
Copy link
Member

Choose a reason for hiding this comment

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

I would check here if error is different than ErrNoSuchKey if that is a case It signals different error than should happen here.

@@ -176,3 +181,36 @@ func publish(ctx context.Context, n *core.IpfsNode, k crypto.PrivKey, ref path.P
Value: ref.String(),
}, nil
}

func keylookup(k string, n *core.IpfsNode) (crypto.PrivKey, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Please make the Node first argument.

change core.IpfsNode as first arg

check keylookup err to propagate validation errors from lower levels

License: MIT
Signed-off-by: Kerem Gocen <keremgocen@gmail.com>
@keremgocen
Copy link
Contributor Author

keremgocen commented Apr 27, 2017

Force pushed on my fork to fix commit message for f93e8c5, should I close this for another PR @Kubuxu ?

@Kubuxu
Copy link
Member

Kubuxu commented Apr 27, 2017

No, force pushes are OK.

test for `ipfs name publish` using PeerID as key name

License: MIT
Signed-off-by: Kerem Gocen <keremgocen@gmail.com>
@keremgocen
Copy link
Contributor Author

keremgocen commented May 8, 2017

Do you have any recommendations for fixing the failing CI here? Also a review is required to proceed this one forward I see.

@Kubuxu
Copy link
Member

Kubuxu commented May 8, 2017

@keremgocen don't worry about travis too much (it likes to fail on its own, we load their machines a bit too much).

Copy link
Member

@whyrusleeping whyrusleeping left a comment

Choose a reason for hiding this comment

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

This LGTM, Thanks @keremgocen!

@whyrusleeping
Copy link
Member

@Kubuxu 👍 here?

@whyrusleeping whyrusleeping merged commit 1c9a419 into ipfs:master May 25, 2017
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