Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
5652af37
Commit
5652af37
authored
Apr 09, 2019
by
Grandschtroumpf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Udapp listen on TxListener
parent
29027496
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
app.js
src/app.js
+1
-0
universal-dapp.js
src/universal-dapp.js
+9
-5
No files found.
src/app.js
View file @
5652af37
...
...
@@ -355,6 +355,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
udapp
:
udapp
.
event
}})
registry
.
put
({
api
:
txlistener
,
name
:
'txlistener'
})
udapp
.
startListening
(
txlistener
)
const
eventsDecoder
=
new
EventsDecoder
({
api
:
{
...
...
src/universal-dapp.js
View file @
5652af37
...
...
@@ -24,12 +24,8 @@ module.exports = class UniversalDApp extends UdappApi {
this
.
events
=
new
EventEmitter
()
this
.
event
=
new
EventManager
()
this
.
_deps
=
{
config
:
registry
.
get
(
'config'
).
api
,
txlistener
:
registry
.
get
(
'txlistener'
).
api
config
:
registry
.
get
(
'config'
).
api
}
this
.
_deps
.
txlistener
.
event
.
register
(
'newTransaction'
,
(
tx
)
=>
{
this
.
events
.
emit
(
'newTransaction'
,
tx
)
})
this
.
_txRunnerAPI
=
{
config
:
this
.
_deps
.
config
,
...
...
@@ -46,6 +42,14 @@ module.exports = class UniversalDApp extends UdappApi {
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
(
executionContext
.
isVM
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment