mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-30 16:47:48 +00:00
use new proc to generate eligibility status
Co-authored-by: gabrielmer <101006718+gabrielmer@users.noreply.github.com>
This commit is contained in:
parent
a3bef8150d
commit
22852d683c
@ -26,7 +26,7 @@ suite "Waku Incentivization Eligibility Codec":
|
|||||||
eligibilityProof == decoded
|
eligibilityProof == decoded
|
||||||
|
|
||||||
asyncTest "encode eligibility status":
|
asyncTest "encode eligibility status":
|
||||||
let eligibilityStatus = genEligibilityStatus(true)
|
let eligibilityStatus = new(EligibilityStatus, true)
|
||||||
let encoded = encode(eligibilityStatus)
|
let encoded = encode(eligibilityStatus)
|
||||||
let decoded = EligibilityStatus.decode(encoded.buffer).get()
|
let decoded = EligibilityStatus.decode(encoded.buffer).get()
|
||||||
check:
|
check:
|
||||||
|
@ -2,7 +2,10 @@ import std/options
|
|||||||
|
|
||||||
import waku/incentivization/rpc
|
import waku/incentivization/rpc
|
||||||
|
|
||||||
proc genEligibilityStatus*(isEligible: bool): EligibilityStatus =
|
proc new*(
|
||||||
|
T: type EligibilityStatus,
|
||||||
|
isEligible: bool
|
||||||
|
): T =
|
||||||
if isEligible:
|
if isEligible:
|
||||||
EligibilityStatus(
|
EligibilityStatus(
|
||||||
statusCode: uint32(200),
|
statusCode: uint32(200),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user