-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
set identity on core mock to fix ipns tests #1524
Conversation
0adad66
to
c64f743
Compare
@jbenet could you run the ipns tests on your laptop? |
@whyrusleeping we should setup FUSE on CI, i believe people found a way to get it on travis ci -- travis-ci/travis-ci#1100 ? |
@@ -54,6 +54,7 @@ func NewMockNode() (*core.IpfsNode, error) { | |||
nd.Peerstore = peer.NewPeerstore() | |||
nd.Peerstore.AddPrivKey(p, ident.PrivateKey()) | |||
nd.Peerstore.AddPubKey(p, ident.PublicKey()) | |||
nd.Identity = p |
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.
Hmm ic, L40 doesn't make it?
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.
@rht you're right, that's a bug. core.Offline(...)
should initialize from the config.Identity
-- though maybe the problem is a lack of a private key? not sure.
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.
well, no. we should be using the nodebuilder here. core.Offline doesnt load identity because it doesnt load the private key, thats an expensive operation that we dont want to happen every time you run a command offline
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.
So this means any tests using coremock.NewMockNode()
loads private key, while the tests that use core.NewIPFSNode
(e.g. https://github.com/ipfs/go-ipfs/blob/master/core/coreunix/add_test.go#L28) don't.
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
License: MIT Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
|
|
set identity on core mock to fix ipns tests
The fuse tests were failing because the mock node didnt have the identity set.
License: MIT
Signed-off-by: Jeromy jeromyj@gmail.com