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
2021ef1d
Commit
2021ef1d
authored
Apr 18, 2016
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Decode ABI for events in VM mode
parent
5ed71995
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
universal-dapp.js
assets/js/universal-dapp.js
+12
-3
No files found.
assets/js/universal-dapp.js
View file @
2021ef1d
...
@@ -183,11 +183,20 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
...
@@ -183,11 +183,20 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
for
(
var
i
in
response
.
vm
.
logs
)
{
for
(
var
i
in
response
.
vm
.
logs
)
{
// [address, topics, mem]
// [address, topics, mem]
var
log
=
response
.
vm
.
logs
[
i
];
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
]);
}
catch
(
e
)
{
decoded
=
'0x'
+
log
[
2
].
toString
(
'hex'
);
}
// FIXME: parse based on ABI (match event name + decode values)
parseLogs
(
null
,
{
event
:
event
,
args
:
decoded
});
parseLogs
(
null
,
{
event
:
event
,
args
:
'0x'
+
log
[
2
].
toString
(
'hex'
)
});
}
}
});
});
}
else
{
}
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