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

feat: add mocha tests to @waku/sdk and cover waitForRemotePeer #2163

Merged
merged 4 commits into from
Oct 8, 2024

Conversation

weboko
Copy link
Collaborator

@weboko weboko commented Oct 6, 2024

Problem

We don't have setup for unit tests in @waku/sdk.

Solution

Add the setup and cover waitForRemotePeers.

Copy link

github-actions bot commented Oct 6, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku node 84.27 KB (+0.06% 🔺) 1.7 s (+0.06% 🔺) 1.3 s (-6.82% 🔽) 3 s
Waku Simple Light Node 135.13 KB (+0.02% 🔺) 2.8 s (+0.02% 🔺) 1.7 s (-10.21% 🔽) 4.4 s
ECIES encryption 22.94 KB (0%) 459 ms (0%) 720 ms (+38.63% 🔺) 1.2 s
Symmetric encryption 22.39 KB (0%) 448 ms (0%) 389 ms (-27.36% 🔽) 837 ms
DNS discovery 72.28 KB (0%) 1.5 s (0%) 1.2 s (+7.14% 🔺) 2.6 s
Peer Exchange discovery 73.88 KB (0%) 1.5 s (0%) 890 ms (-9.98% 🔽) 2.4 s
Local Peer Cache Discovery 67.63 KB (0%) 1.4 s (0%) 905 ms (-7.2% 🔽) 2.3 s
Privacy preserving protocols 75.71 KB (0%) 1.6 s (0%) 1.3 s (+10.77% 🔺) 2.8 s
Waku Filter 78.58 KB (0%) 1.6 s (0%) 1.2 s (-18.51% 🔽) 2.7 s
Waku LightPush 76.83 KB (0%) 1.6 s (0%) 839 ms (-35.92% 🔽) 2.4 s
History retrieval protocols 76.09 KB (0%) 1.6 s (0%) 941 ms (-14.51% 🔽) 2.5 s
Deterministic Message Hashing 7.38 KB (0%) 148 ms (0%) 207 ms (-33.89% 🔽) 354 ms

@weboko weboko changed the base branch from master to weboko/implement-connect October 7, 2024 23:47
@weboko weboko marked this pull request as ready for review October 7, 2024 23:47
@weboko weboko requested a review from a team as a code owner October 7, 2024 23:47
@weboko weboko merged commit 8937a56 into weboko/implement-connect Oct 8, 2024
8 of 10 checks passed
@weboko weboko deleted the weboko/sdk-mocha branch October 8, 2024 11:13
weboko added a commit that referenced this pull request Oct 8, 2024
…#2161)

* fix comment of default number of peers

* export default number of peers from base protocol sdk

* rename to light_push, move class to separate file

* move waitForRemotePeer to sdk package

* add todo to move waitForGossipSubPeerInMesh into @waku/relay

* clean up waitForRemotePeer, split metadata await from event and optimise, decouple from protocol implementations

* simplify and rename ILightPush interface

* use only connected peers in light push based on connections instead of peer renewal mechanism

* improve readability of result processing in light push

* fix check & update tests

* address tests, add new test cases, fix racing condition in StreamManager

* use libp2p.getPeers

* feat: confirm metadata and protocols needed in waitForRemotePeer

* rely on passed protocols and fallback to mounted

* add I prefix to Waku interface

* implement waku.connect method

* add docs to IWaku interface

* remove export and usage of waitForRemotePeer

* move wait for remote peer related to Realy out of @waku/sdk

* change tests to use new API

* fix linting

* update size limit

* rename .connect to .waitForPeer

* export waitForRemotePeer and mark as deprecated

* feat: add mocha tests to @waku/sdk and cover waitForRemotePeer (#2163)

* feat: add mocha tests to @waku/sdk and cover waitForRemotePeer

* add waitForRemote UTs

* remove junk

* feat: expose peerId and protocols from WakuNode (#2166)

* chore: expose peerId and protocols from WakuNode

* remove unused method

* move to private method

* rename to waitForPeers

* up test
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.

2 participants