fix: set default value for version if not on the wire

This commit is contained in:
fryorcraken.eth 2022-08-24 19:06:53 +10:00
parent a58691aabd
commit db22c2e86b
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 4 additions and 2 deletions

View File

@ -273,8 +273,10 @@ export class WakuMessage {
return this.proto.contentTopic;
}
get version(): number | undefined {
return this.proto.version;
get version(): number {
// TODO: absent value should be replaced by default
// value of the type by the protobuf decoder
return this.proto.version ?? 0;
}
get timestamp(): Date | undefined {