Commit a7465e12 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge pull request #5080 from ethereum-optimism/fix/deploy-utils-hanging

contracts-bedrock: fix deploy utils
parents 1d5a265e fbd1f55a
...@@ -54,10 +54,16 @@ export const deploy = async ({ ...@@ -54,10 +54,16 @@ export const deploy = async ({
waitConfirmations: hre.deployConfig.numDeployConfirmations, waitConfirmations: hre.deployConfig.numDeployConfirmations,
}) })
console.log(`Deployed ${name} at ${result.address}`) console.log(`Deployed ${name} at ${result.address}`)
// Only wait for the transaction if it was recently deployed in case the
// result was deployed a long time ago and was pruned from the backend.
await hre.ethers.provider.waitForTransaction(result.transactionHash)
} }
// Always wait for the transaction to be mined, just in case. // Check to make sure there is code
await hre.ethers.provider.waitForTransaction(result.transactionHash) const code = await hre.ethers.provider.getCode(result.address)
if (code === '0x') {
throw new Error(`no code for ${result.address}`)
}
// Create the contract object to return. // Create the contract object to return.
const created = asAdvancedContract({ const created = asAdvancedContract({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment