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 27, 2023
1 parent 3f0a439 commit e46a741
Show file tree
Hide file tree
Showing 2 changed files with 23 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
20 changes: 20 additions & 0 deletions tests/verify_proof/verify_given_proof_test.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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 verifyProofByPaths for bncurve":
assert verifyProofByPaths(pathToKey, pathToProof, pathToLastUpdate, pathToNewUpdate, domain)

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


0 comments on commit e46a741

Please sign in to comment.