Skip to content

Commit

Permalink
test(verifier): Add test for the nim verify function
Browse files Browse the repository at this point in the history
  • Loading branch information
kkirkov committed Jun 28, 2023
1 parent e44c036 commit 78781d8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ jobs:
# - name: Run Verifier in EOS test
# run: nix develop -c yarn test './tests/eosLightClient/test-verifier-in-EOS.ts'

- name: Run Verify given proof - test using bncurve and constantine
run: nix develop -c nim c -r 'tests/verify_proof/verify_given_proof_test.nim'

SolidityVerifierTests:
needs: Tests
runs-on: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions tests/verify_proof/nim.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
path="../../vendor/nim-bncurve"
path="../../vendor/nim-confutils"
path="../../vendor/nim-stew"
path="../../vendor/nim-serialization"
path="../../vendor/nim-faststreams"
path="../../vendor/nimcrypto"
path="../../vendor/constantine"
22 changes: 22 additions & 0 deletions tests/verify_proof/verify_given_proof_test.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import
std/unittest,
# ../../libs/nim/verify-utils/verify_given_proof_constantine,
../../libs/nim/verify-utils/verify_given_proof

suite "description for this stuff":
setup:
let pathToKey = "vendor/eth2-light-client-updates/prater/capella-updates-94/vk.json"
let pathToProof = "vendor/eth2-light-client-updates/prater/capella-updates-94/proof_5609044_5609069.json"
let pathToLastUpdate = "vendor/eth2-light-client-updates/prater/capella-updates-94/update_5601823_5609044.json"
let pathToNewUpdate = "vendor/eth2-light-client-updates/prater/capella-updates-94/update_5609044_5609069.json"
let domain = "0x07000000628941ef21d1fe8c7134720add10bb91e3b02c007e0046d2472c6695"

test "check verifyProof for bncurve":
assert verifyProof(pathToKey, pathToProof, pathToLastUpdate,
pathToNewUpdate, domain)

# test "check verifyProof for constantine":
# assert verifyProofConstantine(pathToKey, pathToProof, pathToLastUpdate,
# pathToNewUpdate, domain)


0 comments on commit 78781d8

Please sign in to comment.