mirror of https://github.com/waku-org/js-waku.git
Ensure waku relay node does not use a sub protocol
At the moment we do not assert that we publish messages over waku relay protocol (not sure this assertion is possible). By asserting we do not register any sub (pubsub, gossipsub, floodsub) protocols, we can be (more) confident that this protocols are not be used behind the scenes.
This commit is contained in:
parent
4329b8006e
commit
b8c63355a5
|
@ -44,6 +44,13 @@ test('Register waku relay protocol', async (t) => {
|
|||
t.truthy(protocols.findIndex((value) => value == CODEC));
|
||||
});
|
||||
|
||||
test('Does not register any sub protocol', async (t) => {
|
||||
const node = await createNode();
|
||||
|
||||
const protocols = Array.from(node.upgrader.protocols.keys());
|
||||
t.truthy(protocols.findIndex((value) => value.match(/sub/)));
|
||||
});
|
||||
|
||||
function waitForNextData(pubsub: Pubsub): Promise<Message> {
|
||||
return new Promise((resolve) => {
|
||||
pubsub.once(TOPIC, resolve);
|
||||
|
|
Loading…
Reference in New Issue