From 21e7ff4b4f180768936151b4195a8270eeb13ab6 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 2 Dec 2020 18:56:08 +0530 Subject: [PATCH] build working fine --- .../src/execution/execution-context.ts | 4 ++-- libs/remix-lib/src/execution/txHelper.ts | 2 +- libs/remix-lib/src/execution/txRunner.ts | 8 +++---- .../src/web3Provider/web3VmProvider.ts | 24 +++++++++---------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/libs/remix-lib/src/execution/execution-context.ts b/libs/remix-lib/src/execution/execution-context.ts index 772ba981db..d8a307141f 100644 --- a/libs/remix-lib/src/execution/execution-context.ts +++ b/libs/remix-lib/src/execution/execution-context.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')) diff --git a/libs/remix-lib/src/execution/txHelper.ts b/libs/remix-lib/src/execution/txHelper.ts index e010684078..1ee42e14bb 100644 --- a/libs/remix-lib/src/execution/txHelper.ts +++ b/libs/remix-lib/src/execution/txHelper.ts @@ -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 } } diff --git a/libs/remix-lib/src/execution/txRunner.ts b/libs/remix-lib/src/execution/txRunner.ts index 58aaecb82a..90e1c14154 100644 --- a/libs/remix-lib/src/execution/txRunner.ts +++ b/libs/remix-lib/src/execution/txRunner.ts @@ -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) diff --git a/libs/remix-lib/src/web3Provider/web3VmProvider.ts b/libs/remix-lib/src/web3Provider/web3VmProvider.ts index ee9bab015a..e0b80277da 100644 --- a/libs/remix-lib/src/web3Provider/web3VmProvider.ts +++ b/libs/remix-lib/src/web3Provider/web3VmProvider.ts @@ -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