improve calculation of TX mined (#886)

This commit is contained in:
nicolas 2020-05-07 17:21:55 -03:00 committed by GitHub
parent 4969db8f61
commit abb600d837
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -252,12 +252,17 @@ const SafeDeployment = ({ creationTxHash, onCancel, onRetry, onSuccess, provider
const isTxMined = async (txHash) => {
const web3 = getWeb3()
const txResult = await web3.eth.getTransaction(txHash)
if (txResult.blockNumber === null) {
return false
}
const receipt = await web3.eth.getTransactionReceipt(txHash)
if (!receipt.status) {
throw Error('TX status reverted')
}
const txResult = await web3.eth.getTransaction(txHash)
return txResult.blockNumber !== null
return true
}
let interval = setInterval(async () => {