-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(rln): Implement rln tests (#2639)
* Implement tests. * Clean coding.
- Loading branch information
1 parent
ebda56d
commit a3fa175
Showing
12 changed files
with
1,064 additions
and
307 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{.used.} | ||
{.push raises: [].} | ||
|
||
import stint | ||
|
||
import | ||
waku/[waku_keystore/protocol_types, waku_rln_relay, waku_rln_relay/protocol_types] | ||
|
||
func fromStrToBytesLe*(v: string): seq[byte] = | ||
try: | ||
return @(hexToUint[256](v).toBytesLE()) | ||
except ValueError: | ||
# this should never happen | ||
return @[] | ||
|
||
func defaultIdentityCredential*(): IdentityCredential = | ||
# zero out the values we don't need | ||
return IdentityCredential( | ||
idTrapdoor: default(IdentityTrapdoor), | ||
idNullifier: default(IdentityNullifier), | ||
idSecretHash: fromStrToBytesLe( | ||
"7984f7c054ad7793d9f31a1e9f29eaa8d05966511e546bced89961eb8874ab9" | ||
), | ||
idCommitment: fromStrToBytesLe( | ||
"51c31de3bff7e52dc7b2eb34fc96813bacf38bde92d27fe326ce5d8296322a7" | ||
), | ||
) | ||
|
||
{.pop.} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.