build working fine

toaster-react
aniket-engg 4 years ago committed by Aniket
parent 2e9b71485e
commit 21e7ff4b4f
  1. 4
      libs/remix-lib/src/execution/execution-context.ts
  2. 2
      libs/remix-lib/src/execution/txHelper.ts
  3. 8
      libs/remix-lib/src/execution/txRunner.ts
  4. 24
      libs/remix-lib/src/web3Provider/web3VmProvider.ts

@ -11,8 +11,8 @@ const LogsManager = require('./logsManager.js')
declare let ethereum: any
let web3
if (typeof window !== 'undefined' && typeof window.ethereum !== 'undefined') {
var injectedProvider = window.ethereum
if (typeof window !== 'undefined' && typeof window['ethereum'] !== 'undefined') {
var injectedProvider = window['ethereum']
web3 = new Web3(injectedProvider)
} else {
web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'))

@ -75,7 +75,7 @@ export function getConstructorInterface (abi) {
if (abi[i].type === 'constructor') {
funABI.inputs = abi[i].inputs || []
funABI.payable = abi[i].payable
funABI.stateMutability = abi[i].stateMutability
funABI['stateMutability'] = abi[i].stateMutability
break
}
}

@ -72,7 +72,7 @@ export class TxRunner {
resolve({
result,
tx,
transactionHash: result ? result.transactionHash : null
transactionHash: result ? result['transactionHash'] : null
})
})
}
@ -176,7 +176,7 @@ export class TxRunner {
const tx = { from: from, to: to, data: data, value: value }
if (useCall) {
tx.gas = gasLimit
tx['gas'] = gasLimit
return this.executionContext.web3().eth.call(tx, function (error, result) {
callback(error, {
result: result,
@ -191,7 +191,7 @@ export class TxRunner {
}
gasEstimationForceSend(err, () => {
// callback is called whenever no error
tx.gas = !gasEstimation ? gasLimit : gasEstimation
tx['gas'] = !gasEstimation ? gasLimit : gasEstimation
if (this._api.config.getUnpersistedProperty('doNotShowTransactionConfirmationAgain')) {
return this._executeTx(tx, null, this._api, promptCb, callback)
@ -203,7 +203,7 @@ export class TxRunner {
return
}
confirmCb(network, tx, tx.gas, (gasPrice) => {
confirmCb(network, tx, tx['gas'], (gasPrice) => {
return this._executeTx(tx, gasPrice, this._api, promptCb, callback)
}, (error) => {
callback(error)

@ -100,26 +100,26 @@ export class Web3VmProvider {
structLogs: []
}
const tx = {}
tx.hash = self.processingHash
tx.from = toChecksumAddress(hexConvert(data.getSenderAddress()))
tx['hash'] = self.processingHash
tx['from'] = toChecksumAddress(hexConvert(data.getSenderAddress()))
if (data.to && data.to.length) {
tx.to = toChecksumAddress(hexConvert(data.to))
tx['to'] = toChecksumAddress(hexConvert(data.to))
}
this.processingAddress = tx.to
tx.data = hexConvert(data.data)
tx.input = hexConvert(data.input)
tx.gas = (new BN(hexConvert(data.gas).replace('0x', ''), 16)).toString(10)
this.processingAddress = tx['to']
tx['data'] = hexConvert(data.data)
tx['input'] = hexConvert(data.input)
tx['gas'] = (new BN(hexConvert(data.gas).replace('0x', ''), 16)).toString(10)
if (data.value) {
tx.value = hexConvert(data.value)
tx['value'] = hexConvert(data.value)
}
self.txs[self.processingHash] = tx
self.txsReceipt[self.processingHash] = tx
self.storageCache[self.processingHash] = {}
if (tx.to) {
const account = toBuffer(tx.to)
if (tx['to']) {
const account = toBuffer(tx['to'])
self.vm.stateManager.dumpStorage(account, (storage) => {
self.storageCache[self.processingHash][tx.to] = storage
self.lastProcessedStorageTxHash[tx.to] = self.processingHash
self.storageCache[self.processingHash][tx['to']] = storage
self.lastProcessedStorageTxHash[tx['to']] = self.processingHash
})
}
this.processingIndex = 0

Loading…
Cancel
Save