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
2af1a920
Commit
2af1a920
authored
Apr 18, 2016
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Decode response ABI only if there supposed to be return values
parent
bbd07fd7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
universal-dapp.js
assets/js/universal-dapp.js
+19
-16
No files found.
assets/js/universal-dapp.js
View file @
2af1a920
...
...
@@ -352,23 +352,26 @@ UniversalDApp.prototype.getCallButton = function(args) {
clearOutput
(
$result
);
$result
.
append
(
getReturnOutput
(
outputObj
)).
append
(
getGasUsedOutput
(
result
.
vm
));
try
{
var
outputTypes
=
[];
for
(
var
i
=
0
;
i
<
args
.
abi
.
outputs
.
length
;
i
++
)
{
outputTypes
.
push
(
args
.
abi
.
outputs
[
i
].
type
);
// Only decode if there supposed to be fields
if
(
args
.
abi
.
outputs
.
length
>
0
)
{
try
{
var
outputTypes
=
[];
for
(
var
i
=
0
;
i
<
args
.
abi
.
outputs
.
length
;
i
++
)
{
outputTypes
.
push
(
args
.
abi
.
outputs
[
i
].
type
);
}
// decode data
var
decodedObj
=
EthJS
.
ABI
.
rawDecode
(
null
,
null
,
outputTypes
,
result
.
vm
.
return
);
// format decoded data
decodedObj
=
EthJS
.
ABI
.
stringify
(
outputTypes
,
decodedObj
);
for
(
var
i
=
0
;
i
<
outputTypes
.
length
;
i
++
)
{
decodedObj
[
i
]
=
outputTypes
[
i
]
+
': '
+
decodedObj
[
i
];
}
$result
.
append
(
getDecodedOutput
(
decodedObj
));
}
catch
(
e
)
{
}
// decode data
var
decodedObj
=
EthJS
.
ABI
.
rawDecode
(
null
,
null
,
outputTypes
,
result
.
vm
.
return
);
// format decoded data
decodedObj
=
EthJS
.
ABI
.
stringify
(
outputTypes
,
decodedObj
);
for
(
var
i
=
0
;
i
<
outputTypes
.
length
;
i
++
)
{
decodedObj
[
i
]
=
outputTypes
[
i
]
+
': '
+
decodedObj
[
i
];
}
$result
.
append
(
getDecodedOutput
(
decodedObj
));
}
catch
(
e
)
{
}
}
else
if
(
args
.
abi
.
constant
&&
!
isConstructor
)
{
replaceOutput
(
$result
,
getReturnOutput
(
result
));
...
...
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