Skip to content

Commit

Permalink
undoing changes as per Hanno's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivansete-status committed Dec 4, 2023
1 parent bc4620e commit 9c37289
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
8 changes: 2 additions & 6 deletions waku/waku_api/rest/filter/types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ else:
{.push raises: [].}

import
std/[sets, strformat, times],
std/[sets, strformat],
chronicles,
json_serialization,
json_serialization/std/options,
Expand Down Expand Up @@ -66,11 +66,7 @@ proc toWakuMessage*(msg: FilterWakuMessage, version = 0): Result[WakuMessage, st
payload = ?msg.payload.decode()
contentTopic = msg.contentTopic.get(DefaultContentTopic)
version = uint32(msg.version.get(version))

var timestamp = msg.timestamp.get(0)

if timestamp == 0:
timestamp = getNanosecondTime(getTime().toUnixFloat())
timestamp = msg.timestamp.get(0)

ok(WakuMessage(payload: payload, contentTopic: contentTopic, version: version, timestamp: timestamp))

Expand Down
2 changes: 1 addition & 1 deletion waku/waku_archive/archive.nim
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type DefaultMessageValidator* = ref object of MessageValidator

method validate*(validator: DefaultMessageValidator, msg: WakuMessage): ValidationResult =
if msg.timestamp == 0:
return err(timestampIsZero)
return ok()

let
now = getNanosecondTime(getTime().toUnixFloat())
Expand Down
1 change: 0 additions & 1 deletion waku/waku_archive/archive_metrics.nim
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ const
invalidMessageFuture* = "invalid_message_future_timestamp"
insertFailure* = "insert_failure"
retPolicyFailure* = "retpolicy_failure"
timestampIsZero* = "msg_timestamp_is_equal_zero"

0 comments on commit 9c37289

Please sign in to comment.