Remove `StrictSign` hack

This commit is contained in:
Franck Royer 2021-03-25 16:13:14 +11:00
parent f2c1c92353
commit 086623243e
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 6 additions and 16 deletions

View File

@ -160,12 +160,6 @@ describe('Waku Relay', () => {
this.timeout(5000); this.timeout(5000);
const message = Message.fromUtf8String('Here is another message.'); const message = Message.fromUtf8String('Here is another message.');
await waku.relay.subscribe();
await new Promise((resolve) =>
waku.libp2p.pubsub.once('gossipsub:heartbeat', resolve)
);
const receivedPromise = waitForNextData(waku.libp2p.pubsub); const receivedPromise = waitForNextData(waku.libp2p.pubsub);
await nimWaku.sendMessage(message); await nimWaku.sendMessage(message);
@ -197,6 +191,12 @@ describe('Waku Relay', () => {
await new Promise((resolve) => await new Promise((resolve) =>
waku.libp2p.pubsub.once('gossipsub:heartbeat', resolve) waku.libp2p.pubsub.once('gossipsub:heartbeat', resolve)
); );
await waku.relay.subscribe();
await new Promise((resolve) =>
waku.libp2p.pubsub.once('gossipsub:heartbeat', resolve)
);
}); });
afterEach(async function () { afterEach(async function () {
@ -213,10 +213,6 @@ describe('Waku Relay', () => {
it('Js publishes to nim', async function () { it('Js publishes to nim', async function () {
const message = Message.fromUtf8String('This is a message'); const message = Message.fromUtf8String('This is a message');
// TODO: nim-waku does not really follow the `StrictNoSign` policy hence we need to change
// it for nim-waku to process our messages. Can be removed once
// https://github.com/status-im/nim-waku/issues/422 is fixed
waku.libp2p.pubsub.globalSignaturePolicy = 'StrictSign';
await waku.relay.publish(message); await waku.relay.publish(message);
@ -234,12 +230,6 @@ describe('Waku Relay', () => {
it('Nim publishes to js', async function () { it('Nim publishes to js', async function () {
const message = Message.fromUtf8String('Here is another message.'); const message = Message.fromUtf8String('Here is another message.');
await waku.relay.subscribe();
await new Promise((resolve) =>
waku.libp2p.pubsub.once('gossipsub:heartbeat', resolve)
);
const receivedPromise = waitForNextData(waku.libp2p.pubsub); const receivedPromise = waitForNextData(waku.libp2p.pubsub);
await nimWaku.sendMessage(message); await nimWaku.sendMessage(message);