-
Notifications
You must be signed in to change notification settings - Fork 445
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
chore: use ed25519 keys in tests #669
Conversation
This should now be unblocked in master. |
I will work on rebase this and get it finished |
5abf287
to
5580435
Compare
There were some tests failing now, due to the persistent peer store, more precisely as a consequence of the following lines:
With ed25519 keys, if we create a peer from the CID, we can get its pubKey through the peerId.pubKey getter. As a consequence, we will have always pubKey. The cleanest solution here is to get from the keyBook again in: https://github.com/libp2p/js-libp2p/blob/master/src/peer-store/persistent/index.js#L213 |
On another note, this PR changes all the tests that use our fixtures (the majority of the tests atm) to use |
d9ff73b
to
9b4b655
Compare
For inlined public keys there's no reason to store their public key, we should avoid doing this it's just a waste of space/datastore transactions. We may want to add an easy way of checking this in |
9b4b655
to
d26eb88
Compare
Inline public keys check was added and tests updated accordingly |
@@ -364,7 +364,7 @@ describe('Identify', () => { | |||
expect(libp2p.identifyService.identify.callCount).to.equal(1) | |||
|
|||
// The connection should have no open streams | |||
expect(connection.streams).to.have.length(0) | |||
await pWaitFor(() => connection.streams.length === 0) |
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.
This was added to prevent a flakey test in Firefox where sometimes the stream was still closing at this moment
Needs: