mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-29 16:15:54 +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
|
||||
|
||||
asyncTest "encode eligibility status":
|
||||
let eligibilityStatus = genEligibilityStatus(true)
|
||||
let eligibilityStatus = new(EligibilityStatus, true)
|
||||
let encoded = encode(eligibilityStatus)
|
||||
let decoded = EligibilityStatus.decode(encoded.buffer).get()
|
||||
check:
|
||||
|
@ -2,7 +2,10 @@ import std/options
|
||||
|
||||
import waku/incentivization/rpc
|
||||
|
||||
proc genEligibilityStatus*(isEligible: bool): EligibilityStatus =
|
||||
proc new*(
|
||||
T: type EligibilityStatus,
|
||||
isEligible: bool
|
||||
): T =
|
||||
if isEligible:
|
||||
EligibilityStatus(
|
||||
statusCode: uint32(200),
|
||||
|
Loading…
x
Reference in New Issue
Block a user