Commit c2d74222 authored by Iuri Matias's avatar Iuri Matias

listen to new transaction using blockchain abstraction instead of txlistener

parent 9ea4b775
...@@ -164,7 +164,7 @@ class TxLogger { ...@@ -164,7 +164,7 @@ class TxLogger {
} }
}) })
this.txListener.event.register('newTransaction', (tx, receipt) => { blockchain.event.register('newTransaction', (tx, receipt) => {
log(this, tx, receipt) log(this, tx, receipt)
}) })
......
...@@ -266,7 +266,10 @@ class Blockchain { ...@@ -266,7 +266,10 @@ class Blockchain {
} }
startListening (txlistener) { startListening (txlistener) {
this.udapp.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
})
} }
runOrCallContractMethod (contractName, contractAbi, funABI, value, address, callType, lookupOnly, logMsg, logCallback, outputCb, confirmationCb, continueCb, promptCb) { runOrCallContractMethod (contractName, contractAbi, funABI, value, address, callType, lookupOnly, logMsg, logCallback, outputCb, confirmationCb, continueCb, promptCb) {
......
...@@ -33,14 +33,6 @@ class UniversalDApp { ...@@ -33,14 +33,6 @@ class UniversalDApp {
this.executionContext.event.register('contextChanged', this.resetEnvironment.bind(this)) 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 () { resetEnvironment () {
this.accounts = {} this.accounts = {}
if (this.executionContext.isVM()) { 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