New `pubsub_topic` field on the `cursor` of Waku Store queries (#596)

This commit is contained in:
Franck R 2022-03-04 16:47:23 +11:00 committed by GitHub
parent 09c269da7f
commit ad5b3ddc7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View File

@ -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).

View File

@ -8,6 +8,7 @@ message Index {
bytes digest = 1;
sint64 received_time = 2;
sint64 sender_time = 3;
string pubsub_topic = 4;
}
message PagingInfo {

View File

@ -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;
},
};