Commit 9a06836a authored by Iuri Matias's avatar Iuri Matias

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

This reverts commit c2d74222.
parent c2d74222
......@@ -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, callType, lookupOnly, logMsg, logCallback, outputCb, confirmationCb, continueCb, promptCb) {
......
......@@ -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()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment