Skip to content

Commit e48d4c7

Browse files
committed
chore: use automine for local deployments
1 parent 468786d commit e48d4c7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

cli/commands/migrate.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { constants, utils } from 'ethers'
1+
import { constants, providers, utils } from 'ethers'
22
import yargs, { Argv } from 'yargs'
33

44
import { logger } from '../logging'
@@ -41,6 +41,7 @@ export const migrate = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise<vo
4141
const chainId = cli.chainId
4242

4343
if (chainId == 1337) {
44+
await (cli.wallet.provider as providers.JsonRpcProvider).send('evm_setAutomine', [true])
4445
allContracts = ['EthereumDIDRegistry', ...allContracts]
4546
}
4647

@@ -132,6 +133,10 @@ export const migrate = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise<vo
132133
const spent = formatEther(cli.balance.sub(await cli.wallet.getBalance()))
133134
const nTx = (await cli.wallet.getTransactionCount()) - cli.nonce
134135
logger.info(`Sent ${nTx} transaction${nTx === 1 ? '' : 's'} & spent ${EtherSymbol} ${spent}`)
136+
137+
if (chainId == 1337) {
138+
await (cli.wallet.provider as providers.JsonRpcProvider).send('evm_setAutomine', [false])
139+
}
135140
}
136141

137142
export const migrateCommand = {

hardhat.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ const config: HardhatUserConfig = {
129129
},
130130
mining: {
131131
auto: false,
132-
interval: 30000,
132+
interval: 13000,
133133
},
134134
hardfork: 'london',
135135
},

0 commit comments

Comments
 (0)