Skip to content

Commit

Permalink
add sleep in script
Browse files Browse the repository at this point in the history
  • Loading branch information
liuhaoyang committed Sep 14, 2023
1 parent 028d311 commit faba895
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/contracts/deploy/011-AddressDictator.deploy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Imports: External */
import { DeployFunction } from 'hardhat-deploy/dist/types'
import { hexStringEquals } from '@mantleio/core-utils'
import { hexStringEquals, sleep } from '@mantleio/core-utils'

/* Imports: Internal */
import {
Expand Down Expand Up @@ -75,6 +75,8 @@ const deployFn: DeployFunction = async (hre) => {
return !hexStringEquals(existingAddresses[name], address)
})

await sleep(10000)

await deployAndVerifyAndThen({
hre,
name: names.unmanaged.AddressDictator,
Expand Down
14 changes: 11 additions & 3 deletions packages/contracts/tasks/fraud-proof-tasks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { task } from 'hardhat/config'
import { ethers } from 'ethers'
import { hexStringEquals } from '@mantleio/core-utils'
import {hexStringEquals, sleep} from '@mantleio/core-utils'

// @ts-ignore
import { getContractFactory } from '../src'
Expand Down Expand Up @@ -112,6 +112,7 @@ task('rollupStake')
}

await mantle.connect(deployer).transfer(stakerWallet.address, mantleAmount)
await sleep(10000)
console.log(
'balance: ',
stakerWallet.address,
Expand All @@ -122,22 +123,29 @@ task('rollupStake')
'ETH Balance:',
stakerWallet.address,
' ',
await stakerWallet.getBalance()
(await stakerWallet.getBalance()).toString()
)
await sleep(10000)
await mantle
.connect(stakerWallet)
.approve(taskArgs.rollup, ethers.utils.parseEther(taskArgs.amount))

await sleep(10000);
console.log(
'ETH Balance:',
stakerWallet.address,
' ',
await stakerWallet.getBalance()
(await stakerWallet.getBalance()).toString()
)

await sleep(10000)

console.log('stake', stakerWallet.address, operators[i])
await rollup
.connect(stakerWallet)
.stake(ethers.utils.parseEther(taskArgs.amount), operators[i])

await sleep(10000)
}
})

Expand Down

0 comments on commit faba895

Please sign in to comment.