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
b98a95d1
Commit
b98a95d1
authored
Aug 15, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove code for event
parent
a354e881
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
57 deletions
+0
-57
universal-dapp.js
src/universal-dapp.js
+0
-57
No files found.
src/universal-dapp.js
View file @
b98a95d1
...
@@ -248,63 +248,7 @@ UniversalDApp.prototype.renderInstance = function (contract, address, contractNa
...
@@ -248,63 +248,7 @@ UniversalDApp.prototype.renderInstance = function (contract, address, contractNa
copy
(
address
)
copy
(
address
)
}
}
var
$events
=
$
(
'<div class="events"/>'
)
var
parseLogs
=
function
(
err
,
response
)
{
if
(
err
)
{
return
}
var
$event
=
$
(
'<div class="event" />'
)
var
close
=
yo
`<div class="udapp-close" onclick=
${
remove
}
><i class="
${
css
.
closeIcon
}
fa fa-close" aria-hidden="true"></i></div>`
function
remove
()
{
$event
.
remove
()
}
$event
.
append
(
$
(
'<span class="name"/>'
).
text
(
response
.
event
))
.
append
(
$
(
'<span class="args" />'
).
text
(
JSON
.
stringify
(
response
.
args
,
null
,
2
)))
$event
.
get
(
0
).
appendChild
(
close
)
$events
.
append
(
$event
)
}
var
abi
=
txHelper
.
sortAbiFunction
(
contract
)
var
abi
=
txHelper
.
sortAbiFunction
(
contract
)
if
(
this
.
executionContext
.
isVM
())
{
// FIXME: support indexed events
var
eventABI
=
{}
$
.
each
(
abi
,
function
(
i
,
funABI
)
{
if
(
funABI
.
type
!==
'event'
)
{
return
}
var
hash
=
ethJSABI
.
eventID
(
funABI
.
name
,
funABI
.
inputs
.
map
(
function
(
item
)
{
return
item
.
type
}))
eventABI
[
hash
.
toString
(
'hex'
)]
=
{
event
:
funABI
.
name
,
inputs
:
funABI
.
inputs
}
})
this
.
vm
.
on
(
'afterTx'
,
function
(
response
)
{
for
(
var
i
in
response
.
vm
.
logs
)
{
// [address, topics, mem]
var
log
=
response
.
vm
.
logs
[
i
]
var
event
var
decoded
try
{
var
abi
=
eventABI
[
log
[
1
][
0
].
toString
(
'hex'
)]
event
=
abi
.
event
var
types
=
abi
.
inputs
.
map
(
function
(
item
)
{
return
item
.
type
})
decoded
=
ethJSABI
.
rawDecode
(
types
,
log
[
2
])
decoded
=
ethJSABI
.
stringify
(
types
,
decoded
)
}
catch
(
e
)
{
decoded
=
'0x'
+
log
[
2
].
toString
(
'hex'
)
}
parseLogs
(
null
,
{
event
:
event
,
args
:
decoded
})
}
})
}
else
{
var
eventFilter
=
this
.
web3
.
eth
.
contract
(
abi
).
at
(
address
).
allEvents
()
eventFilter
.
watch
(
parseLogs
)
}
$instance
.
get
(
0
).
appendChild
(
title
)
$instance
.
get
(
0
).
appendChild
(
title
)
...
@@ -330,7 +274,6 @@ UniversalDApp.prototype.renderInstance = function (contract, address, contractNa
...
@@ -330,7 +274,6 @@ UniversalDApp.prototype.renderInstance = function (contract, address, contractNa
}))
}))
})
})
$instance
.
append
(
$events
)
return
$instance
.
get
(
0
)
return
$instance
.
get
(
0
)
}
}
...
...
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