fix readme and tests

This commit is contained in:
Drygin 2022-02-14 13:27:44 +03:00
parent bb2e4186bf
commit f4df191ed2
2 changed files with 7 additions and 6 deletions

View File

@ -28,11 +28,12 @@ Check config.js for actual values.
With `salt` = `0x0000000000000000000000000000000000000000000000000000000047941987` addresses must be: With `salt` = `0x0000000000000000000000000000000000000000000000000000000047941987` addresses must be:
1. `L1Unwrapper` - `0xfEADF5e7e453c664D903d1b1945c524c4328e1c5` 1. `L1Unwrapper` - `0xfEADF5e7e453c664D903d1b1945c524c4328e1c5`
2. `TornadoPool` - `0xEb314843E39A2D67c7bA31150fA243b30b70e97c` 2. `TornadoPool` - `0x6a1c06C4Af066a35291117611fd0418411c0dbD0`
Check addresses with current config: Check addresses with current config:
```shell ```shell
yarn compile
node -e 'require("./src/0_generateAddresses").generateWithLog()' node -e 'require("./src/0_generateAddresses").generateWithLog()'
``` ```
@ -42,7 +43,7 @@ Deploy L1Unwrapper:
npx hardhat run scripts/deployL1Unwrapper.js --network mainnet npx hardhat run scripts/deployL1Unwrapper.js --network mainnet
``` ```
Deploy TornadoPool: Deploy TornadoPool Upgrade:
```shell ```shell
npx hardhat run scripts/deployTornadoUpgrade.js --network xdai npx hardhat run scripts/deployTornadoUpgrade.js --network xdai

View File

@ -46,7 +46,7 @@ describe('TornadoPool', function () {
const singletonFactory = await ethers.getContractAt('SingletonFactory', config.singletonFactory) const singletonFactory = await ethers.getContractAt('SingletonFactory', config.singletonFactory)
let customConfig = Object.assign({}, config) let customConfig = Object.assign({}, config)
customConfig.omniBridge = amb.address customConfig.omniBridge = omniBridge.address
customConfig.weth = l1Token.address customConfig.weth = l1Token.address
const contracts = await generate(customConfig) const contracts = await generate(customConfig)
await singletonFactory.deploy(contracts.unwrapperContract.bytecode, config.salt) await singletonFactory.deploy(contracts.unwrapperContract.bytecode, config.salt)
@ -350,13 +350,13 @@ describe('TornadoPool', function () {
extAmount, extAmount,
onTokenBridgedData, onTokenBridgedData,
) )
// emulating bridge. first it sends tokens to amb mock then it sends to the recipient // emulating bridge. first it sends tokens to omniBridge mock then it sends to the recipient
await l1Token.transfer(amb.address, extAmount) await l1Token.transfer(omniBridge.address, extAmount)
transferTx = await l1Token.populateTransaction.transfer(l1Unwrapper.address, extAmount) transferTx = await l1Token.populateTransaction.transfer(l1Unwrapper.address, extAmount)
const senderBalanceBefore = await ethers.provider.getBalance(sender.address) const senderBalanceBefore = await ethers.provider.getBalance(sender.address)
let tx = await amb.execute([ let tx = await omniBridge.execute([
{ who: l1Token.address, callData: transferTx.data }, // send tokens to L1Unwrapper { who: l1Token.address, callData: transferTx.data }, // send tokens to L1Unwrapper
{ who: l1Unwrapper.address, callData: onTokenBridgedTx.data }, // call onTokenBridged on L1Unwrapper { who: l1Unwrapper.address, callData: onTokenBridgedTx.data }, // call onTokenBridged on L1Unwrapper
]) ])