Revert "listen to new transaction using blockchain abstraction instead of txlistener"

This reverts commit c2d7422266.
pull/5370/head
Iuri Matias 5 years ago committed by yann300
parent bfa947c8cc
commit a2c9400bbd
  1. 2
      src/app/ui/txLogger.js
  2. 5
      src/blockchain/blockchain.js
  3. 8
      src/blockchain/universalDapp.js

@ -164,7 +164,7 @@ class TxLogger {
}
})
blockchain.event.register('newTransaction', (tx, receipt) => {
this.txListener.event.register('newTransaction', (tx, receipt) => {
log(this, tx, receipt)
})

@ -266,10 +266,7 @@ class Blockchain {
}
startListening (txlistener) {
txlistener.event.register('newTransaction', (tx, receipt) => {
this.event.emit('newTransaction', tx, receipt)
this.udapp.events.emit('newTransaction', tx, receipt) // for plugin backwards compatibility
})
this.udapp.startListening(txlistener)
}
runOrCallContractMethod (contractName, contractABI, funABI, value, address, params, lookupOnly, logMsg, logCallback, outputCb, callbacksInContext) {

@ -33,6 +33,14 @@ class UniversalDApp {
this.executionContext.event.register('contextChanged', this.resetEnvironment.bind(this))
}
// TODO : event should be triggered by Udapp instead of TxListener
/** Listen on New Transaction. (Cannot be done inside constructor because txlistener doesn't exist yet) */
startListening (txlistener) {
txlistener.event.register('newTransaction', (tx) => {
this.events.emit('newTransaction', tx)
})
}
resetEnvironment () {
this.accounts = {}
if (this.executionContext.isVM()) {

Loading…
Cancel
Save