From ad5b3ddc7fdcf356e7cf9cd04ccdace6b8a6df0b Mon Sep 17 00:00:00 2001 From: Franck R Date: Fri, 4 Mar 2022 16:47:23 +1100 Subject: [PATCH] New `pubsub_topic` field on the `cursor` of Waku Store queries (#596) --- CHANGELOG.md | 4 ++++ proto/waku/v2/store/v2beta4/store.proto | 1 + src/proto/waku/v2/store/v2beta4/store.ts | 12 ++++++++++++ 3 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb31a2088a..6d9b5ae0ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- New `pubsub_topic` field on the `cursor` of Waku Store queries ([#585](https://github.com/status-im/js-waku/issues/595)). + ### Changed - Add `exports` to `package.json` for NodeJS usage (not officially supported but helpful for experiments). diff --git a/proto/waku/v2/store/v2beta4/store.proto b/proto/waku/v2/store/v2beta4/store.proto index ea6b8cb546..0a72ec6f09 100644 --- a/proto/waku/v2/store/v2beta4/store.proto +++ b/proto/waku/v2/store/v2beta4/store.proto @@ -8,6 +8,7 @@ message Index { bytes digest = 1; sint64 received_time = 2; sint64 sender_time = 3; + string pubsub_topic = 4; } message PagingInfo { diff --git a/src/proto/waku/v2/store/v2beta4/store.ts b/src/proto/waku/v2/store/v2beta4/store.ts index 628a2d7bf9..1fe800b925 100644 --- a/src/proto/waku/v2/store/v2beta4/store.ts +++ b/src/proto/waku/v2/store/v2beta4/store.ts @@ -9,6 +9,7 @@ export interface Index { digest: Uint8Array; receivedTime: Long; senderTime: Long; + pubsubTopic: string; } export interface PagingInfo { @@ -118,6 +119,7 @@ function createBaseIndex(): Index { digest: new Uint8Array(), receivedTime: Long.ZERO, senderTime: Long.ZERO, + pubsubTopic: "", }; } @@ -132,6 +134,9 @@ export const Index = { if (!message.senderTime.isZero()) { writer.uint32(24).sint64(message.senderTime); } + if (message.pubsubTopic !== "") { + writer.uint32(34).string(message.pubsubTopic); + } return writer; }, @@ -151,6 +156,9 @@ export const Index = { case 3: message.senderTime = reader.sint64() as Long; break; + case 4: + message.pubsubTopic = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -170,6 +178,7 @@ export const Index = { senderTime: isSet(object.senderTime) ? Long.fromString(object.senderTime) : Long.ZERO, + pubsubTopic: isSet(object.pubsubTopic) ? String(object.pubsubTopic) : "", }; }, @@ -183,6 +192,8 @@ export const Index = { (obj.receivedTime = (message.receivedTime || Long.ZERO).toString()); message.senderTime !== undefined && (obj.senderTime = (message.senderTime || Long.ZERO).toString()); + message.pubsubTopic !== undefined && + (obj.pubsubTopic = message.pubsubTopic); return obj; }, @@ -197,6 +208,7 @@ export const Index = { object.senderTime !== undefined && object.senderTime !== null ? Long.fromValue(object.senderTime) : Long.ZERO; + message.pubsubTopic = object.pubsubTopic ?? ""; return message; }, };