-
Notifications
You must be signed in to change notification settings - Fork 43
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
fix(tests): peer-exchange interop #1773
Conversation
size-limit report 📦
|
12b1a1d
to
1ab3d58
Compare
37f070f
to
dca2f6e
Compare
peerInfos.find( | ||
({ ENR }) => ENR?.peerInfo?.id.toString() === nwaku1PeerId.toString() | ||
) !== undefined; | ||
peerInfos.find(({ ENR }) => { |
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.
I would not use .find
in that case and would use .forEach
since side effects important so that presence of foundNodePeerId
is the result.
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.
changed it to use some
which seems more appropriate & efficient
({ ENR }) => ENR?.peerInfo?.id.toString() === nwaku1PeerId.toString() | ||
) !== undefined; | ||
const foundNodeMultiaddrs: Multiaddr[] = []; | ||
const foundNodePeerId: PeerId | undefined = undefined; |
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.
these values never get set, so that it will always throw
at :87
and if not it will dial
empty maddrs
array
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.
haha, you're right which is why the test failed as well. this caught in during the refactor from find
to some
-- addressed this -- thanks! :)
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.
merging this PR now, let me know if you want to suggest any other change & I can follow up
Problem
The current peer-exchange interop test does not correctly test the functionality
Solution