-
Context: Taken from Patrick - NFT Marketplace Back-end - Script: moveBlocks
Code: async function moveBlocks(amount, sleepAmount = 0) {
console.log("Moving blocks...")
for (let index = 0; index < amount; index++) {
await network.provider.request({
method: "evm_mine",
params: [],
})
if (sleepAmount) {
console.log(`Sleeping for ${sleepAmount}`)
await sleep(sleepAmount)
}
}
console.log(`Moved ${amount} blocks`)
}
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Doing |
Beta Was this translation helpful? Give feedback.
Doing
moveBlocks(<amount>, sleepAmount = <insert a number>)
overrides thesleepAmount = 0
in the method signature - hence satisfying the if-statement.