Skip to content

Commit 8d1e0c7

Browse files
yann300Aniket-Engg
authored andcommitted
contine polling if contract address not available
1 parent 8c90936 commit 8d1e0c7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

libs/remix-lib/src/execution/txRunnerWeb3.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,22 @@ export class TxRunnerWeb3 {
175175
}
176176
}
177177

178-
async function tryTillReceiptAvailable (txhash, web3) {
178+
async function tryTillReceiptAvailable (txhash: string, web3: Web3) {
179179
try {
180180
const receipt = await web3.eth.getTransactionReceipt(txhash)
181-
if (receipt) return receipt
181+
if (receipt) {
182+
if (!receipt.to && !receipt.contractAddress) {
183+
// this is a contract creation and the receipt doesn't contain a contract address. we have to keep polling...
184+
console.log('this is a contract creation and the receipt does nott contain a contract address. we have to keep polling...')
185+
} else
186+
return receipt
187+
}
182188
} catch (e) {}
183189
await pause()
184190
return await tryTillReceiptAvailable(txhash, web3)
185191
}
186192

187-
async function tryTillTxAvailable (txhash, web3) {
193+
async function tryTillTxAvailable (txhash: string, web3: Web3) {
188194
try {
189195
const tx = await web3.eth.getTransaction(txhash)
190196
if (tx && tx.blockHash) return tx

0 commit comments

Comments
 (0)