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 declare let ethereum: any
let web3 let web3
if (typeof window !== 'undefined' && typeof window.ethereum !== 'undefined') { if (typeof window !== 'undefined' && typeof window['ethereum'] !== 'undefined') {
var injectedProvider = window.ethereum var injectedProvider = window['ethereum']
web3 = new Web3(injectedProvider) web3 = new Web3(injectedProvider)
} else { } else {
web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545')) web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'))

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

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

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

Loading…
Cancel
Save