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
82648700
Commit
82648700
authored
Apr 27, 2016
by
chriseth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #155 from axic/patch/vm-events-v2
Decode ABI when parsing VM events
parents
5ed71995
b675386b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
universal-dapp.js
assets/js/universal-dapp.js
+13
-3
No files found.
assets/js/universal-dapp.js
View file @
82648700
...
...
@@ -183,11 +183,21 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
for
(
var
i
in
response
.
vm
.
logs
)
{
// [address, topics, mem]
var
log
=
response
.
vm
.
logs
[
i
];
var
abi
=
eventABI
[
log
[
1
][
0
].
toString
(
'hex'
)];
var
event
=
abi
.
event
;
var
decoded
;
var
event
=
eventABI
[
log
[
1
][
0
].
toString
(
'hex'
)].
event
;
try
{
var
types
=
abi
.
inputs
.
map
(
function
(
item
)
{
return
item
.
type
;
});
decoded
=
EthJS
.
ABI
.
rawDecode
(
types
,
log
[
2
]);
decoded
=
EthJS
.
ABI
.
stringify
(
types
,
decoded
)
}
catch
(
e
)
{
decoded
=
'0x'
+
log
[
2
].
toString
(
'hex'
);
}
// FIXME: parse based on ABI (match event name + decode values)
parseLogs
(
null
,
{
event
:
event
,
args
:
'0x'
+
log
[
2
].
toString
(
'hex'
)
});
parseLogs
(
null
,
{
event
:
event
,
args
:
decoded
});
}
});
}
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