just send the tx if "VM"

auto_exec_v2
yann300 3 years ago
parent ca1cf72103
commit c213e6d165
  1. 14
      libs/remix-lib/src/execution/txRunnerWeb3.ts

@ -101,16 +101,16 @@ export class TxRunnerWeb3 {
// // @todo(#378) this should be removed when https://github.com/WalletConnect/walletconnect-monorepo/issues/334 is fixed
callback(new Error('Gas estimation failed because of an unknown internal error. This may indicated that the transaction will fail.'))
}
this._api.detectNetwork((errNetWork, network) => {
if (errNetWork) {
console.log(errNetWork)
return
}
err = network.name === 'VM' ? null : err // just send the tx if "VM"
gasEstimationForceSend(err, () => {
// callback is called whenever no error
tx['gas'] = !gasEstimation ? gasLimit : gasEstimation
this._api.detectNetwork((err, network) => {
if (err) {
console.log(err)
return
}
if (this._api.config.getUnpersistedProperty('doNotShowTransactionConfirmationAgain')) {
return this._executeTx(tx, network, null, this._api, promptCb, callback)
}
@ -120,7 +120,6 @@ export class TxRunnerWeb3 {
}, (error) => {
callback(error)
})
})
}, () => {
const blockGasLimit = this.currentblockGasLimit()
// NOTE: estimateGas very likely will return a large limit if execution of the code failed
@ -138,6 +137,7 @@ export class TxRunnerWeb3 {
}
})
})
})
}
}

Loading…
Cancel
Save