fix using checkRevertBeforeSending and ignoreGasPricing

pull/5370/head
yann300 1 year ago committed by Aniket
parent c66563d06b
commit bcf37e9005
  1. 4
      apps/remix-ide/src/app/plugins/solidity-script.tsx
  2. 2
      apps/remix-ide/src/blockchain/execution-context.js
  3. 1
      apps/remix-ide/src/blockchain/providers/vm.ts
  4. 2
      libs/ghaction-helper/src/methods.ts
  5. 2
      libs/remix-debug/test/vmCall.ts
  6. 4
      libs/remix-lib/src/execution/txRunnerWeb3.ts
  7. 3
      libs/remix-simulator/src/VmProxy.ts

@ -73,13 +73,13 @@ export class SolidityScript extends Plugin {
from: accounts[0],
data: bytecode
}
const receipt = await web3.eth.sendTransaction(tx)
const receipt = await web3.eth.sendTransaction(tx, null, { checkRevertBeforeSending: false, ignoreGasPricing: true })
tx = {
from: accounts[0],
to: receipt.contractAddress,
data: '0x69d4394b' // function remixRun() public
}
const receiptCall = await web3.eth.sendTransaction(tx)
const receiptCall = await web3.eth.sendTransaction(tx, null, { checkRevertBeforeSending: false, ignoreGasPricing: true })
const hhlogs = await web3.remix.getHHLogsForTx(receiptCall.transactionHash)

@ -7,7 +7,7 @@ const _paq = window._paq = window._paq || []
let web3
const config = { defaultTransactionType: '0x0', ignoreGasPricing: true }
const config = { defaultTransactionType: '0x0' }
if (typeof window !== 'undefined' && typeof window.ethereum !== 'undefined') {
var injectedProvider = window.ethereum
web3 = new Web3(injectedProvider)

@ -62,6 +62,7 @@ export class VMProvider {
}
}
this.web3 = new Web3(this.provider as LegacySendAsyncProvider)
this.web3.setConfig({ defaultTransactionType: '0x0' })
extend(this.web3)
this.executionContext.setWeb3(this.executionContext.getProvider(), this.web3)
resolve({})

@ -11,7 +11,7 @@ const providerConfig = {
blockNumber: global.blockNumber || null
}
const config = { defaultTransactionType: '0x0', ignoreGasPricing: true }
const config = { defaultTransactionType: '0x0' }
global.remixProvider = new Provider(providerConfig)
global.remixProvider.init()
global.web3Provider = new ethers.providers.Web3Provider(global.remixProvider)

@ -23,7 +23,7 @@ async function sendTx (web3, from, to, value, data, cb) {
value,
data,
gas: 7000000
})
}, null, { checkRevertBeforeSending: false, ignoreGasPricing: true })
cb(null, receipt.transactionHash)
return receipt.transactionHash
} catch (e) {

@ -65,7 +65,7 @@ export class TxRunnerWeb3 {
promptCb(
async (value) => {
try {
const res = await (this.getWeb3() as any).eth.personal.sendTransaction({...tx, value})
const res = await (this.getWeb3() as any).eth.personal.sendTransaction({...tx, value}, { checkRevertBeforeSending: false, ignoreGasPricing: true })
cb(null, res.transactionHash)
} catch (e) {
console.log(`Send transaction failed: ${e.message} . if you use an injected provider, please check it is properly unlocked. `)
@ -81,7 +81,7 @@ export class TxRunnerWeb3 {
)
} else {
try {
const res = await this.getWeb3().eth.sendTransaction(tx, null, { checkRevertBeforeSending: false })
const res = await this.getWeb3().eth.sendTransaction(tx, null, { checkRevertBeforeSending: false, ignoreGasPricing: true})
cb(null, res.transactionHash)
} catch (e) {
console.log(`Send transaction failed: ${e.message} . if you use an injected provider, please check it is properly unlocked. `)

@ -123,6 +123,7 @@ export class VmProxy {
this.stateCopy = await this.vm.stateManager.copy()
this.incr++
this.processingHash = bufferToHex(data.hash())
console.log('txWillProcess', this.processingHash )
this.vmTraces[this.processingHash] = {
gas: '0x0',
return: '0x0',
@ -158,6 +159,7 @@ export class VmProxy {
}
async txProcessed (data: AfterTxEvent) {
console.log('txProcessed', this.processingHash)
if (this.flagDoNotRecordEVMSteps) {
this.flagDoNotRecordEVMSteps = false
return
@ -260,6 +262,7 @@ export class VmProxy {
this.vmTraces[this.processingHash].structLogs.push(step)
// Track hardhat console.log call
if (step.op === 'STATICCALL' && toHexPaddedString(step.stack[step.stack.length - 2]) === '0x000000000000000000000000000000000000000000636f6e736f6c652e6c6f67') {
console.log('STATICCALL', this.processingHash)
const payloadStart = parseInt(toHexPaddedString(step.stack[step.stack.length - 3]), 16)
const memory = formatMemory(data.memory)
const memoryStr = memory.join('')

Loading…
Cancel
Save