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
5ed71995
Commit
5ed71995
authored
Apr 27, 2016
by
chriseth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #153 from axic/patch/vm-event-names
Display event names in VM mode
parents
93d240df
38d15365
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
universal-dapp.js
assets/js/universal-dapp.js
+13
-1
No files found.
assets/js/universal-dapp.js
View file @
5ed71995
...
...
@@ -169,13 +169,25 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
}
if
(
self
.
options
.
vm
){
// FIXME: support indexed events
var
eventABI
=
{};
$
.
each
(
abi
,
function
(
i
,
funABI
)
{
if
(
funABI
.
type
!==
'event'
)
return
;
var
hash
=
EthJS
.
ABI
.
eventID
(
funABI
.
name
,
funABI
.
inputs
.
map
(
function
(
item
)
{
return
item
.
type
}))
eventABI
[
hash
.
toString
(
'hex'
)]
=
{
event
:
funABI
.
name
,
inputs
:
funABI
.
inputs
};
});
self
.
vm
.
on
(
'afterTx'
,
function
(
response
){
for
(
var
i
in
response
.
vm
.
logs
)
{
// [address, topics, mem]
var
log
=
response
.
vm
.
logs
[
i
];
var
event
=
eventABI
[
log
[
1
][
0
].
toString
(
'hex'
)].
event
;
// FIXME: parse based on ABI (match event name + decode values)
parseLogs
(
null
,
{
event
:
log
[
1
][
0
].
toString
(
'hex'
)
,
args
:
'0x'
+
log
[
2
].
toString
(
'hex'
)
});
parseLogs
(
null
,
{
event
:
event
,
args
:
'0x'
+
log
[
2
].
toString
(
'hex'
)
});
}
});
}
else
{
...
...
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