0xEigenLabs / eigen-secret

Confidential Transaction with Collaborative Traceability, zk-zkRollup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test case design

eigmax opened this issue · comments

Now the simple tests have been passed as per the Readme, the next step we need make sure the complex cases work well.

common setup: deploy contracts, and register one token at least, can use gist scripts here.

id operations result expected pass or not fix
0 common setup;
alice deposit(s) 10;
alias deposit(s) 10;
error_1 Alice's balance should be 20 n #84
1 common setup;
alice deposit(s) 10;
alias deposit(s) 10;
alias deposit(s) 10;
Bob deposit(s) 10;
Bob deposit(s) 10;
Bob sends Alice 11
- Alice's balance should be 41;
Bob's Balance should be 9
y -
2 case 1;
Bob withdraw(s) 9
error_1 Alice's balance should be 41;
Bob's Balance should be 0
n #84
3 case 2;
Alice withdraw(s) 12
error_2 Alice's balance should be 29;
Bob's Balance should be 0
n #85
4 case 3;
Alice send(s) Bob 11
- Alice's balance should be 18;
Bob's Balance should be 11
y -
5 case 4;
Alice withdraw(s) 18
- Alice's balance should be 0;
Bob's Balance should be 11
y -
6 case 5;
Bob withdraw(s) 11
- Alice's balance should be 0;
Bob's Balance should be 0
y -

Error:

  1. error_1
Error: Error: Assert Failed.
Error in template JoinSplit_491 line: 256
Error in template UpdateState_492 line: 102

    at /home/dell/Projects/eigen-secret/circuits/main_update_state_js/witness_calculator.js:161:27
    at Array.forEach (<anonymous>)
    at WitnessCalculator._doCalculateWitness (/home/dell/Projects/eigen-secret/circuits/main_update_state_js/witness_calculator.js:136:14)
    at WitnessCalculator.calculateWTNSBin (/home/dell/Projects/eigen-secret/circuits/main_update_state_js/witness_calculator.js:212:20)
    at Function.updateState (/home/dell/Projects/eigen-secret/core/dist/prover.js:15:55)
    at async SecretSDK.deposit (/home/dell/Projects/eigen-secret/sdk/dist/index.js:243:41)
    at async SimpleTaskDefinition.action (/home/dell/Projects/eigen-secret/tasks/transaction.ts:61:33)
    at async Environment._runTaskDefinition (/home/dell/Projects/eigen-secret/node_modules/hardhat/src/internal/core/runtime-environment.ts:330:14)
    at async Environment.run (/home/dell/Projects/eigen-secret/node_modules/hardhat/src/internal/core/runtime-environment.ts:163:14)
    at async main (/home/dell/Projects/eigen-secret/node_modules/hardhat/src/internal/cli/cli.ts:277:7)
  1. error_2
AssertionError: expected '1303082764185517615576280214259830761…' to equal '1835262063073854652783164453804654101…'
    at SecretSDK.withdraw (/home/dell/Projects/eigen-secret/sdk/dist/index.js:519:51)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async SimpleTaskDefinition.action (/home/dell/Projects/eigen-secret/tasks/transaction.ts:150:33)
    at async Environment._runTaskDefinition (/home/dell/Projects/eigen-secret/node_modules/hardhat/src/internal/core/runtime-environment.ts:330:14)
    at async Environment.run (/home/dell/Projects/eigen-secret/node_modules/hardhat/src/internal/core/runtime-environment.ts:163:14)
    at async main (/home/dell/Projects/eigen-secret/node_modules/hardhat/src/internal/cli/cli.ts:277:7) {
  showDiff: true,
  actual: '13030827641855176155762802142598307611003275052490893836070115368930574435547',
  expected: '18352620630738546527831644538046541017872781130675447308190206077745304755598',
  operator: 'strictEqual'
}