Skip to content

Commit 410d703

Browse files
committed
Fix message equality assert in tests
1 parent 44a77b4 commit 410d703

3 files changed

Lines changed: 4 additions & 16 deletions

File tree

tests/waku_filter_v2/test_rpc_codec.nim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ suite "Waku Filter v2 - codec wire format":
1919
test "decode of a request omitting field 2 defaults to SUBSCRIBER_PING":
2020
let decoded = FilterSubscribeRequest.decode(PingRequestNoType)
2121
check decoded.isOk()
22-
check decoded.get().requestId == "x"
23-
check decoded.get().filterSubscribeType == FilterSubscribeType.SUBSCRIBER_PING
22+
check decoded.get() == FilterSubscribeRequest.ping("x")
2423

2524
test "FilterSubscribeRequest round-trips (subscribe with topics)":
2625
let req = FilterSubscribeRequest.subscribe(

tests/waku_lightpush/test_rpc_codec.nim

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ suite "Waku Lightpush v3 - codec wire format":
2828
)
2929
let decoded = LightPushResponse.decode(resp.encode())
3030
check decoded.isOk()
31-
check decoded.get().requestId == resp.requestId
32-
check decoded.get().statusCode == resp.statusCode
33-
check decoded.get().statusDesc == resp.statusDesc
34-
check decoded.get().relayPeerCount == resp.relayPeerCount
31+
check decoded.get() == resp
3532

3633
test "LightpushRequest round-trips with nested WakuMessage":
3734
let req = LightpushRequest(
@@ -41,6 +38,4 @@ suite "Waku Lightpush v3 - codec wire format":
4138
)
4239
let decoded = LightpushRequest.decode(req.encode())
4340
check decoded.isOk()
44-
check decoded.get().requestId == req.requestId
45-
check decoded.get().pubSubTopic == req.pubSubTopic
46-
check decoded.get().message == req.message
41+
check decoded.get() == req

tests/waku_rln_relay/test_rate_limit_proof_codec.nim

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@ suite "RLN RateLimitProof codec":
2222
check decoded.isOk()
2323
let d = decoded.get()
2424
check:
25-
d.proof == proof.proof
26-
d.merkleRoot == proof.merkleRoot
27-
d.epoch == proof.epoch
28-
d.shareX == proof.shareX
29-
d.shareY == proof.shareY
30-
d.nullifier == proof.nullifier
31-
d.rlnIdentifier == proof.rlnIdentifier
25+
d == proof
3226
# re-encoding the decoded proof yields identical bytes
3327
d.encode() == encoded
3428

0 commit comments

Comments
 (0)