From 1d7d364b40fba5f51d3375595819715a60e58699 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 27 Dec 2019 15:53:07 -0500 Subject: [PATCH] use blockchain object instead of executionContext in transactionReceiptResolver --- src/app.js | 2 +- src/app/udapp/make-udapp.js | 4 ++-- src/lib/transactionReceiptResolver.js | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app.js b/src/app.js index cc461898c5..f6746b7d34 100644 --- a/src/app.js +++ b/src/app.js @@ -236,7 +236,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org const compilersArtefacts = new CompilersArtefacts() // store all the compilation results (key represent a compiler name) registry.put({api: compilersArtefacts, name: 'compilersartefacts'}) - const {eventsDecoder, txlistener} = makeUdapp(udapp, executionContext, compilersArtefacts, (domEl) => mainview.getTerminal().logHtml(domEl)) + const {eventsDecoder, txlistener} = makeUdapp(blockchain, udapp, executionContext, compilersArtefacts, (domEl) => mainview.getTerminal().logHtml(domEl)) // ----------------- network service (resolve network id / name) ---------------------------- const networkModule = new NetworkModule(executionContext) // ----------------- convert offset to line/column service ---------------------------- diff --git a/src/app/udapp/make-udapp.js b/src/app/udapp/make-udapp.js index 04f32fef74..45d0713ec1 100644 --- a/src/app/udapp/make-udapp.js +++ b/src/app/udapp/make-udapp.js @@ -5,7 +5,7 @@ var Txlistener = remixLib.execution.txListener var EventsDecoder = remixLib.execution.EventsDecoder var TransactionReceiptResolver = require('../../lib/transactionReceiptResolver') -export function makeUdapp (udapp, executionContext, compilersArtefacts, logHtmlCallback) { +export function makeUdapp (blockchain, udapp, executionContext, compilersArtefacts, logHtmlCallback) { // ----------------- UniversalDApp ----------------- // TODO: to remove when possible udapp.event.register('transactionBroadcasted', (txhash, networkName) => { @@ -14,7 +14,7 @@ export function makeUdapp (udapp, executionContext, compilersArtefacts, logHtmlC }) // ----------------- Tx listener ----------------- - const transactionReceiptResolver = new TransactionReceiptResolver(executionContext) + const transactionReceiptResolver = new TransactionReceiptResolver(blockchain) const txlistener = new Txlistener({ api: { diff --git a/src/lib/transactionReceiptResolver.js b/src/lib/transactionReceiptResolver.js index 78608eff31..06d1e08cdd 100644 --- a/src/lib/transactionReceiptResolver.js +++ b/src/lib/transactionReceiptResolver.js @@ -1,16 +1,16 @@ 'use strict' module.exports = class TransactionReceiptResolver { - constructor (executionContext) { + constructor (blockchain) { this._transactionReceipts = {} - this.executionContext = executionContext + this.blockchain = blockchain } resolve (tx, cb) { if (this._transactionReceipts[tx.hash]) { return cb(null, this._transactionReceipts[tx.hash]) } - this.executionContext.web3().eth.getTransactionReceipt(tx.hash, (error, receipt) => { + this.blockchain.web3().eth.getTransactionReceipt(tx.hash, (error, receipt) => { if (!error) { this._transactionReceipts[tx.hash] = receipt cb(null, receipt)