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

Conversation

Projects
None yet
3 participants
@keremgocen
Contributor

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

add PeerID lookup
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 {

This comment has been minimized.

@Kubuxu

Kubuxu Apr 27, 2017

Member

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) {

This comment has been minimized.

@Kubuxu

Kubuxu Apr 27, 2017

Member

Please make the Node first argument.

code review improvements
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

This comment has been minimized.

Contributor

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

This comment has been minimized.

Member

Kubuxu commented Apr 27, 2017

No, force pushes are OK.

add sharness tests
test for `ipfs name publish` using PeerID as key name

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

This comment has been minimized.

Contributor

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

This comment has been minimized.

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).

@whyrusleeping

This LGTM, Thanks @keremgocen!

@whyrusleeping

This comment has been minimized.

Member

whyrusleeping commented May 20, 2017

@Kubuxu 👍 here?

@Kubuxu

Kubuxu approved these changes May 20, 2017

@whyrusleeping whyrusleeping merged commit 1c9a419 into ipfs:master May 25, 2017

4 of 7 checks passed

codecov/patch 57.14% of diff hit (target 63.11%)
Details
codecov/project 62.81% (-0.31%) compared to d59554a
Details
continuous-integration/travis-ci/pr The Travis CI build failed
Details
ci/circleci Your tests passed on CircleCI!
Details
codeclimate no new or fixed issues
Details
commit-message-check/gitcop All commit messages are valid
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment