diff --git a/CHANGELOG.md b/CHANGELOG.md index fb5b65aa7e..b7d52d07c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Published files moved from `build` to `dist/`. +- Migrate from ts-proto to protons; + the latter does not bring Buffer/Long deps, is ESM compatible and remove the need for bufbuild and protoc. ## [0.24.0] - 2022-05-27 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 94b32c50b4..189ba7e06f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,8 +20,6 @@ To help ensure your PR passes, just run before committing: To build and test this repository, you need: - [Node.js & npm](https://nodejs.org/en/). - - [bufbuild](https://github.com/bufbuild/buf) (only if changing protobuf files). - - [protoc](https://grpc.io/docs/protoc-installation/) (only if changing protobuf files). - Chrome (for browser testing). - g++ & make (to build nim-waku) diff --git a/src/lib/waku_message/index.ts b/src/lib/waku_message/index.ts index 2368fc5960..804e395353 100644 --- a/src/lib/waku_message/index.ts +++ b/src/lib/waku_message/index.ts @@ -7,6 +7,7 @@ import * as version_1 from "./version_1"; const DefaultVersion = 0; const dbg = debug("waku:message"); +const OneMillion = BigInt(1_000_000); export enum DecryptionMethod { Asymmetric = "asymmetric", @@ -103,7 +104,7 @@ export class WakuMessage { payload: _payload, timestampDeprecated: timestamp.valueOf() / 1000, // milliseconds 10^-3 to nanoseconds 10^-9 - timestamp: BigInt(timestamp.valueOf()) * BigInt(1_000_000), + timestamp: BigInt(timestamp.valueOf()) * OneMillion, version, contentTopic, }, @@ -283,7 +284,7 @@ export class WakuMessage { try { if (this.proto.timestamp) { // nanoseconds 10^-9 to milliseconds 10^-3 - const timestamp = this.proto.timestamp / BigInt(1_000_000); + const timestamp = this.proto.timestamp / OneMillion; return new Date(Number(timestamp)); } diff --git a/src/lib/waku_store/index.ts b/src/lib/waku_store/index.ts index 35e1e4da35..3cad6bb492 100644 --- a/src/lib/waku_store/index.ts +++ b/src/lib/waku_store/index.ts @@ -221,7 +221,6 @@ export class WakuStore { const response = reply.response as protoV2Beta4.HistoryResponse; - console.log("Response", response); if (response.error && response.error !== Error.ERROR_NONE_UNSPECIFIED) { throw "History response contains an Error: " + response.error; }