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
ad7c0577
Commit
ad7c0577
authored
Jan 27, 2015
by
Marek Kotewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getMethodWithName
parent
f0236814
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
32 deletions
+32
-32
ethereum.js
dist/ethereum.js
+15
-15
ethereum.js.map
dist/ethereum.js.map
+1
-1
ethereum.min.js
dist/ethereum.min.js
+1
-1
abi.js
lib/abi.js
+15
-15
No files found.
dist/ethereum.js
View file @
ad7c0577
...
...
@@ -56,6 +56,16 @@ var findMethodIndex = function (json, methodName) {
});
};
/// @returns method with given method name
var
getMethodWithName
=
function
(
json
,
methodName
)
{
var
index
=
findMethodIndex
(
json
,
methodName
);
if
(
index
===
-
1
)
{
console
.
error
(
'method '
+
methodName
+
' not found in the abi'
);
return
undefined
;
}
return
json
[
index
];
};
/// @param string string to be padded
/// @param number of characters that result string should have
/// @param sign, by default 0
...
...
@@ -159,13 +169,8 @@ var inputTypes = setupInputTypes();
/// @returns bytes representation of input params
var
toAbiInput
=
function
(
json
,
methodName
,
params
)
{
var
bytes
=
""
;
var
index
=
findMethodIndex
(
json
,
methodName
);
if
(
index
===
-
1
)
{
return
;
}
var
method
=
json
[
index
]
;
var
method
=
getMethodWithName
(
json
,
methodName
)
;
var
padding
=
ETH_PADDING
*
2
;
/// first we iterate in search for dynamic
...
...
@@ -281,16 +286,10 @@ var outputTypes = setupOutputTypes();
/// @param bytes representtion of output
/// @returns array of output params
var
fromAbiOutput
=
function
(
json
,
methodName
,
output
)
{
var
index
=
findMethodIndex
(
json
,
methodName
);
if
(
index
===
-
1
)
{
return
;
}
output
=
output
.
slice
(
2
);
var
result
=
[];
var
method
=
json
[
index
]
;
var
method
=
getMethodWithName
(
json
,
methodName
)
;
var
padding
=
ETH_PADDING
*
2
;
var
dynamicPartLength
=
method
.
outputs
.
reduce
(
function
(
acc
,
curr
)
{
...
...
@@ -404,7 +403,8 @@ module.exports = {
outputParser
:
outputParser
,
methodSignature
:
methodSignature
,
methodDisplayName
:
methodDisplayName
,
methodTypeName
:
methodTypeName
methodTypeName
:
methodTypeName
,
getMethodWithName
:
getMethodWithName
};
...
...
dist/ethereum.js.map
View file @
ad7c0577
This diff is collapsed.
Click to expand it.
dist/ethereum.min.js
View file @
ad7c0577
This diff is collapsed.
Click to expand it.
lib/abi.js
View file @
ad7c0577
...
...
@@ -55,6 +55,16 @@ var findMethodIndex = function (json, methodName) {
});
};
/// @returns method with given method name
var
getMethodWithName
=
function
(
json
,
methodName
)
{
var
index
=
findMethodIndex
(
json
,
methodName
);
if
(
index
===
-
1
)
{
console
.
error
(
'method '
+
methodName
+
' not found in the abi'
);
return
undefined
;
}
return
json
[
index
];
};
/// @param string string to be padded
/// @param number of characters that result string should have
/// @param sign, by default 0
...
...
@@ -158,13 +168,8 @@ var inputTypes = setupInputTypes();
/// @returns bytes representation of input params
var
toAbiInput
=
function
(
json
,
methodName
,
params
)
{
var
bytes
=
""
;
var
index
=
findMethodIndex
(
json
,
methodName
);
if
(
index
===
-
1
)
{
return
;
}
var
method
=
json
[
index
]
;
var
method
=
getMethodWithName
(
json
,
methodName
)
;
var
padding
=
ETH_PADDING
*
2
;
/// first we iterate in search for dynamic
...
...
@@ -280,16 +285,10 @@ var outputTypes = setupOutputTypes();
/// @param bytes representtion of output
/// @returns array of output params
var
fromAbiOutput
=
function
(
json
,
methodName
,
output
)
{
var
index
=
findMethodIndex
(
json
,
methodName
);
if
(
index
===
-
1
)
{
return
;
}
output
=
output
.
slice
(
2
);
var
result
=
[];
var
method
=
json
[
index
]
;
var
method
=
getMethodWithName
(
json
,
methodName
)
;
var
padding
=
ETH_PADDING
*
2
;
var
dynamicPartLength
=
method
.
outputs
.
reduce
(
function
(
acc
,
curr
)
{
...
...
@@ -403,6 +402,7 @@ module.exports = {
outputParser
:
outputParser
,
methodSignature
:
methodSignature
,
methodDisplayName
:
methodDisplayName
,
methodTypeName
:
methodTypeName
methodTypeName
:
methodTypeName
,
getMethodWithName
:
getMethodWithName
};
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