mirror of
https://github.com/tornadocash/tornado-core.git
synced 2024-11-22 01:37:07 +01:00
fix tests
This commit is contained in:
parent
14e15ba6c0
commit
e8fa073caf
@ -127,6 +127,7 @@ contract('Mixer', accounts => {
|
||||
|
||||
const input = stringifyBigInts({
|
||||
root,
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(32)),
|
||||
nullifier: deposit.nullifier,
|
||||
receiver,
|
||||
fee,
|
||||
@ -179,16 +180,18 @@ contract('Mixer', accounts => {
|
||||
const input = stringifyBigInts({
|
||||
// public
|
||||
root,
|
||||
nullifier: deposit.nullifier,
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(32)),
|
||||
receiver,
|
||||
fee,
|
||||
|
||||
// private
|
||||
nullifier: deposit.nullifier,
|
||||
secret: deposit.secret,
|
||||
pathElements: path_elements,
|
||||
pathIndex: path_index,
|
||||
})
|
||||
|
||||
|
||||
const proof = await websnarkUtils.genWitnessAndProve(groth16, input, circuit, proving_key)
|
||||
const { pi_a, pi_b, pi_c, publicSignals } = websnarkUtils.toSolidityInput(proof)
|
||||
|
||||
@ -207,7 +210,7 @@ contract('Mixer', accounts => {
|
||||
balanceRecieverAfter.should.be.eq.BN(toBN(balanceRecieverBefore).add(toBN(value)).sub(feeBN))
|
||||
|
||||
logs[0].event.should.be.equal('Withdraw')
|
||||
logs[0].args.nullifier.should.be.eq.BN(toBN(deposit.nullifier.toString()))
|
||||
logs[0].args.nullifier.should.be.eq.BN(toBN(input.nullifierHash.toString()))
|
||||
logs[0].args.fee.should.be.eq.BN(feeBN)
|
||||
})
|
||||
|
||||
@ -220,6 +223,7 @@ contract('Mixer', accounts => {
|
||||
|
||||
const input = stringifyBigInts({
|
||||
root,
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(32)),
|
||||
nullifier: deposit.nullifier,
|
||||
receiver,
|
||||
fee,
|
||||
@ -244,6 +248,7 @@ contract('Mixer', accounts => {
|
||||
const oneEtherFee = bigInt(1e18) // 1 ether
|
||||
const input = stringifyBigInts({
|
||||
root,
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(32)),
|
||||
nullifier: deposit.nullifier,
|
||||
receiver,
|
||||
fee: oneEtherFee,
|
||||
@ -266,6 +271,7 @@ contract('Mixer', accounts => {
|
||||
const { root, path_elements, path_index } = await tree.path(0)
|
||||
|
||||
const input = stringifyBigInts({
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(32)),
|
||||
root,
|
||||
nullifier: deposit.nullifier,
|
||||
receiver,
|
||||
@ -293,6 +299,7 @@ contract('Mixer', accounts => {
|
||||
|
||||
const input = stringifyBigInts({
|
||||
root,
|
||||
nullifierHash: pedersenHash(deposit.nullifier.leInt2Buff(32)),
|
||||
nullifier: deposit.nullifier,
|
||||
receiver,
|
||||
fee,
|
||||
|
Loading…
Reference in New Issue
Block a user