mirror of
https://github.com/tornadocash/tornado-nova
synced 2024-02-02 14:53:56 +01:00
minor refactor
This commit is contained in:
parent
576ba47938
commit
454adf3720
@ -18,24 +18,23 @@ describe('TornadoPool', function () {
|
|||||||
async function deploy(contractName, ...args) {
|
async function deploy(contractName, ...args) {
|
||||||
const Factory = await ethers.getContractFactory(contractName)
|
const Factory = await ethers.getContractFactory(contractName)
|
||||||
const instance = await Factory.deploy(...args)
|
const instance = await Factory.deploy(...args)
|
||||||
await instance.deployed()
|
return instance.deployed()
|
||||||
|
|
||||||
return instance
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fixture() {
|
async function fixture() {
|
||||||
const [deployer] = await ethers.getSigners()
|
|
||||||
|
|
||||||
const verifier2 = await deploy('Verifier2')
|
const verifier2 = await deploy('Verifier2')
|
||||||
|
|
||||||
const verifier16 = await deploy('Verifier16')
|
const verifier16 = await deploy('Verifier16')
|
||||||
|
|
||||||
const tree = new MerkleTree(MERKLE_TREE_HEIGHT, [], { hashFunction: poseidonHash2 })
|
const tree = new MerkleTree(MERKLE_TREE_HEIGHT, [], { hashFunction: poseidonHash2 })
|
||||||
const root = await tree.root()
|
|
||||||
/** @type {TornadoPool} */
|
/** @type {TornadoPool} */
|
||||||
const tornadoPool = await deploy('TornadoPool', verifier2.address, verifier16.address, toFixedHex(root))
|
const tornadoPool = await deploy(
|
||||||
|
'TornadoPool',
|
||||||
|
verifier2.address,
|
||||||
|
verifier16.address,
|
||||||
|
toFixedHex(tree.root()),
|
||||||
|
)
|
||||||
|
|
||||||
return { tornadoPool, deployer }
|
return { tornadoPool }
|
||||||
}
|
}
|
||||||
|
|
||||||
it('encrypt -> decrypt should work', () => {
|
it('encrypt -> decrypt should work', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user