Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
113a3809
Commit
113a3809
authored
Jan 25, 2015
by
Gav Wood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix string outputs.
Auto collapse for < 2 returns.
parent
fb34c6c7
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
8 deletions
+26
-8
ethereum.js
dist/ethereum.js
+11
-2
ethereum.js.map
dist/ethereum.js.map
+3
-3
ethereum.min.js
dist/ethereum.min.js
+1
-1
abi.js
lib/abi.js
+1
-1
contract.js
lib/contract.js
+10
-1
No files found.
dist/ethereum.js
View file @
113a3809
...
@@ -252,7 +252,7 @@ var formatOutputAddress = function (value) {
...
@@ -252,7 +252,7 @@ var formatOutputAddress = function (value) {
};
};
var
dynamicBytesLength
=
function
(
type
)
{
var
dynamicBytesLength
=
function
(
type
)
{
if
(
arrayType
(
type
)
||
prefixedType
(
'string'
)(
type
))
if
(
arrayType
(
type
)
||
type
==
'string'
)
// only string itself that is dynamic; stringX is static length.
return
ETH_PADDING
*
2
;
return
ETH_PADDING
*
2
;
return
0
;
return
0
;
};
};
...
@@ -501,6 +501,7 @@ var contract = function (address, desc) {
...
@@ -501,6 +501,7 @@ var contract = function (address, desc) {
options
.
data
=
signature
+
parsed
;
options
.
data
=
signature
+
parsed
;
var
isTransact
=
result
.
_isTransact
===
true
||
(
result
.
_isTransact
!==
false
&&
!
method
.
constant
);
var
isTransact
=
result
.
_isTransact
===
true
||
(
result
.
_isTransact
!==
false
&&
!
method
.
constant
);
var
collapse
=
options
.
collapse
!==
false
;
// reset
// reset
result
.
_options
=
{};
result
.
_options
=
{};
...
@@ -518,7 +519,15 @@ var contract = function (address, desc) {
...
@@ -518,7 +519,15 @@ var contract = function (address, desc) {
}
}
var
output
=
web3
.
eth
.
call
(
options
);
var
output
=
web3
.
eth
.
call
(
options
);
return
outputParser
[
displayName
][
typeName
](
output
);
var
ret
=
outputParser
[
displayName
][
typeName
](
output
);
if
(
collapse
)
{
if
(
ret
.
length
==
1
)
ret
=
ret
[
0
];
else
if
(
ret
.
length
==
0
)
ret
=
null
;
}
return
ret
;
};
};
if
(
result
[
displayName
]
===
undefined
)
{
if
(
result
[
displayName
]
===
undefined
)
{
...
...
dist/ethereum.js.map
View file @
113a3809
This diff is collapsed.
Click to expand it.
dist/ethereum.min.js
View file @
113a3809
This diff is collapsed.
Click to expand it.
lib/abi.js
View file @
113a3809
...
@@ -251,7 +251,7 @@ var formatOutputAddress = function (value) {
...
@@ -251,7 +251,7 @@ var formatOutputAddress = function (value) {
};
};
var
dynamicBytesLength
=
function
(
type
)
{
var
dynamicBytesLength
=
function
(
type
)
{
if
(
arrayType
(
type
)
||
prefixedType
(
'string'
)(
type
))
if
(
arrayType
(
type
)
||
type
==
'string'
)
// only string itself that is dynamic; stringX is static length.
return
ETH_PADDING
*
2
;
return
ETH_PADDING
*
2
;
return
0
;
return
0
;
};
};
...
...
lib/contract.js
View file @
113a3809
...
@@ -90,6 +90,7 @@ var contract = function (address, desc) {
...
@@ -90,6 +90,7 @@ var contract = function (address, desc) {
options
.
data
=
signature
+
parsed
;
options
.
data
=
signature
+
parsed
;
var
isTransact
=
result
.
_isTransact
===
true
||
(
result
.
_isTransact
!==
false
&&
!
method
.
constant
);
var
isTransact
=
result
.
_isTransact
===
true
||
(
result
.
_isTransact
!==
false
&&
!
method
.
constant
);
var
collapse
=
options
.
collapse
!==
false
;
// reset
// reset
result
.
_options
=
{};
result
.
_options
=
{};
...
@@ -107,7 +108,15 @@ var contract = function (address, desc) {
...
@@ -107,7 +108,15 @@ var contract = function (address, desc) {
}
}
var
output
=
web3
.
eth
.
call
(
options
);
var
output
=
web3
.
eth
.
call
(
options
);
return
outputParser
[
displayName
][
typeName
](
output
);
var
ret
=
outputParser
[
displayName
][
typeName
](
output
);
if
(
collapse
)
{
if
(
ret
.
length
==
1
)
ret
=
ret
[
0
];
else
if
(
ret
.
length
==
0
)
ret
=
null
;
}
return
ret
;
};
};
if
(
result
[
displayName
]
===
undefined
)
{
if
(
result
[
displayName
]
===
undefined
)
{
...
...
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