mirror of
https://github.com/waku-org/js-waku.git
synced 2025-02-18 07:16:33 +00:00
Update nwaku RPC with nanoseconds timestamp
This commit is contained in:
parent
09e227f5a7
commit
c8300d4dfc
@ -64,7 +64,7 @@ export interface KeyPair {
|
|||||||
export interface WakuRelayMessage {
|
export interface WakuRelayMessage {
|
||||||
payload: string;
|
payload: string;
|
||||||
contentTopic?: string;
|
contentTopic?: string;
|
||||||
timestamp?: number; // Float in seconds
|
timestamp?: number; // Integer in seconds
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NimWaku {
|
export class NimWaku {
|
||||||
@ -194,12 +194,7 @@ export class NimWaku {
|
|||||||
}
|
}
|
||||||
let timestamp;
|
let timestamp;
|
||||||
if (message.timestamp) {
|
if (message.timestamp) {
|
||||||
timestamp = message.timestamp.valueOf() / 1000;
|
timestamp = message.timestamp.valueOf() * 1000;
|
||||||
if (Number.isInteger(timestamp)) {
|
|
||||||
// Add a millisecond to ensure it's not an integer
|
|
||||||
// Until https://github.com/status-im/nim-waku/issues/691 is done
|
|
||||||
timestamp += 0.001;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const rpcMessage = {
|
const rpcMessage = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user