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
37e94196
Commit
37e94196
authored
Jun 09, 2016
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UDapp: indent after latest change
parent
00f41bf2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
33 deletions
+33
-33
universal-dapp.js
src/universal-dapp.js
+33
-33
No files found.
src/universal-dapp.js
View file @
37e94196
...
@@ -448,35 +448,35 @@ UniversalDApp.prototype.getCallButton = function (args) {
...
@@ -448,35 +448,35 @@ UniversalDApp.prototype.getCallButton = function (args) {
}
}
var
decodeResponse
=
function
(
response
)
{
var
decodeResponse
=
function
(
response
)
{
// Only decode if there supposed to be fields
// Only decode if there supposed to be fields
if
(
args
.
abi
.
outputs
.
length
>
0
)
{
if
(
args
.
abi
.
outputs
.
length
>
0
)
{
try
{
try
{
var
i
;
var
i
;
var
outputTypes
=
[];
var
outputTypes
=
[];
for
(
i
=
0
;
i
<
args
.
abi
.
outputs
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
args
.
abi
.
outputs
.
length
;
i
++
)
{
outputTypes
.
push
(
args
.
abi
.
outputs
[
i
].
type
);
outputTypes
.
push
(
args
.
abi
.
outputs
[
i
].
type
);
}
}
// decode data
// decode data
var
decodedObj
=
ethJSABI
.
rawDecode
(
outputTypes
,
response
);
var
decodedObj
=
ethJSABI
.
rawDecode
(
outputTypes
,
response
);
// format decoded data
// format decoded data
decodedObj
=
ethJSABI
.
stringify
(
outputTypes
,
decodedObj
);
decodedObj
=
ethJSABI
.
stringify
(
outputTypes
,
decodedObj
);
for
(
i
=
0
;
i
<
outputTypes
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
outputTypes
.
length
;
i
++
)
{
var
name
=
args
.
abi
.
outputs
[
i
].
name
;
var
name
=
args
.
abi
.
outputs
[
i
].
name
;
if
(
name
.
length
>
0
)
{
if
(
name
.
length
>
0
)
{
decodedObj
[
i
]
=
outputTypes
[
i
]
+
' '
+
name
+
': '
+
decodedObj
[
i
];
decodedObj
[
i
]
=
outputTypes
[
i
]
+
' '
+
name
+
': '
+
decodedObj
[
i
];
}
else
{
}
else
{
decodedObj
[
i
]
=
outputTypes
[
i
]
+
': '
+
decodedObj
[
i
];
decodedObj
[
i
]
=
outputTypes
[
i
]
+
': '
+
decodedObj
[
i
];
}
}
}
return
getDecodedOutput
(
decodedObj
);
}
catch
(
e
)
{
return
getDecodedOutput
(
'Failed to decode output: '
+
e
);
}
}
return
getDecodedOutput
(
decodedObj
);
}
catch
(
e
)
{
return
getDecodedOutput
(
'Failed to decode output: '
+
e
);
}
}
}
};
};
var
decoded
;
var
decoded
;
...
@@ -497,18 +497,18 @@ UniversalDApp.prototype.getCallButton = function (args) {
...
@@ -497,18 +497,18 @@ UniversalDApp.prototype.getCallButton = function (args) {
clearOutput
(
$result
);
clearOutput
(
$result
);
$result
.
append
(
getReturnOutput
(
outputObj
)).
append
(
getGasUsedOutput
(
result
,
result
.
vm
));
$result
.
append
(
getReturnOutput
(
outputObj
)).
append
(
getGasUsedOutput
(
result
,
result
.
vm
));
decoded
=
decodeResponse
(
result
.
vm
.
return
);
decoded
=
decodeResponse
(
result
.
vm
.
return
);
if
(
decoded
)
{
if
(
decoded
)
{
$result
.
append
(
decoded
);
$result
.
append
(
decoded
);
}
}
}
else
if
(
args
.
abi
.
constant
&&
!
isConstructor
)
{
}
else
if
(
args
.
abi
.
constant
&&
!
isConstructor
)
{
clearOutput
(
$result
);
clearOutput
(
$result
);
$result
.
append
(
getReturnOutput
(
result
)).
append
(
getGasUsedOutput
({}));
$result
.
append
(
getReturnOutput
(
result
)).
append
(
getGasUsedOutput
({}));
decoded
=
decodeResponse
(
ethJSUtil
.
toBuffer
(
result
));
decoded
=
decodeResponse
(
ethJSUtil
.
toBuffer
(
result
));
if
(
decoded
)
{
if
(
decoded
)
{
$result
.
append
(
decoded
);
$result
.
append
(
decoded
);
}
}
}
else
{
}
else
{
clearOutput
(
$result
);
clearOutput
(
$result
);
$result
.
append
(
getReturnOutput
(
result
)).
append
(
getGasUsedOutput
(
result
));
$result
.
append
(
getReturnOutput
(
result
)).
append
(
getGasUsedOutput
(
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