diff --git a/nim-waku b/nim-waku index 5d138f8a2c..286482ea32 160000 --- a/nim-waku +++ b/nim-waku @@ -1 +1 @@ -Subproject commit 5d138f8a2c3f18703cfe6f7497e5d3fba074cdf2 +Subproject commit 286482ea32401952ff01b80ad7cc183cb9336c06 diff --git a/proto/waku/v2/store.proto b/proto/waku/v2/store.proto index b2d078b7b4..b58dd485ad 100644 --- a/proto/waku/v2/store.proto +++ b/proto/waku/v2/store.proto @@ -9,33 +9,27 @@ message Index { double received_time = 2; } -message PagingInfoQuery { - uint32 page_size = 1; // TODO: See https://github.com/vacp2p/rfc/issues/326 - Index cursor = 2; - Direction direction = 3; -} - enum Direction { DIRECTION_BACKWARD_UNSPECIFIED = 0; DIRECTION_FORWARD = 1; } -message PagingInfoResponse { - uint64 page_size = 1; // TODO: See https://github.com/vacp2p/rfc/issues/326 +message PagingInfo { + uint64 page_size = 1; Index cursor = 2; Direction direction = 3; } message HistoryQuery { - repeated string topics = 1; - optional PagingInfoQuery paging_info = 2; - optional double start_time = 3; - optional double end_time = 4; + repeated string topics = 2; + optional PagingInfo paging_info = 3; + optional double start_time = 4; + optional double end_time = 5; } message HistoryResponse { repeated WakuMessageProto messages = 1; - PagingInfoResponse paging_info = 2; + PagingInfo paging_info = 2; } message HistoryRPC { diff --git a/src/lib/waku_relay/index.spec.ts b/src/lib/waku_relay/index.spec.ts index c7adbdcb3a..ac83e30dfb 100644 --- a/src/lib/waku_relay/index.spec.ts +++ b/src/lib/waku_relay/index.spec.ts @@ -133,9 +133,12 @@ describe('Waku Relay', () => { await waku.relay.publish(message); - await nimWaku.waitForLog('WakuMessage received'); + let msgs = []; - const msgs = await nimWaku.messages(); + while (msgs.length === 0) { + await delay(200); + msgs = await nimWaku.messages(); + } expect(msgs[0].contentTopic).to.equal(message.contentTopic); expect(msgs[0].version).to.equal(message.version); @@ -206,9 +209,12 @@ describe('Waku Relay', () => { await waku.relay.publish(message); - await nimWaku.waitForLog('WakuMessage received'); + let msgs = []; - const msgs = await nimWaku.messages(); + while (msgs.length === 0) { + await delay(200); + msgs = await nimWaku.messages(); + } expect(msgs[0].contentTopic).to.equal(message.contentTopic); expect(msgs[0].version).to.equal(message.version); diff --git a/src/lib/waku_store/index.spec.ts b/src/lib/waku_store/index.spec.ts index 6ceffb691a..686d199306 100644 --- a/src/lib/waku_store/index.spec.ts +++ b/src/lib/waku_store/index.spec.ts @@ -59,8 +59,7 @@ describe('Waku Store', () => { const response = await waku.store.queryHistory(nimPeerId); const messages = response?.messages; - // TODO: Should be fixed with https://github.com/status-im/nim-waku/issues/471 - // expect(messages?.length).eq(2); + expect(messages?.length).eq(2); const result = messages ?.map((protoMsg) => { return WakuMessage.fromProto(protoMsg);