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
0538c115
Commit
0538c115
authored
Jan 09, 2015
by
Marek Kotewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sha3 method signature
parent
807ec60e
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
12 deletions
+40
-12
ethereum.js
dist/ethereum.js
+18
-4
ethereum.js.map
dist/ethereum.js.map
+3
-3
ethereum.min.js
dist/ethereum.min.js
+1
-1
abi.js
lib/abi.js
+14
-2
contract.js
lib/contract.js
+4
-2
No files found.
dist/ethereum.js
View file @
0538c115
...
...
@@ -141,7 +141,6 @@ var toAbiInput = function (json, methodName, params) {
return
;
}
bytes
=
"0x"
+
padLeft
(
index
.
toString
(
16
),
2
);
var
method
=
json
[
index
];
for
(
var
i
=
0
;
i
<
method
.
inputs
.
length
;
i
++
)
{
...
...
@@ -260,9 +259,22 @@ var outputParser = function (json) {
return
parser
;
};
var
methodSignature
=
function
(
json
,
name
)
{
var
method
=
json
[
findMethodIndex
(
json
,
name
)];
var
result
=
name
+
'('
;
var
inputTypes
=
method
.
inputs
.
map
(
function
(
inp
)
{
return
inp
.
type
;
});
result
+=
inputTypes
.
join
(
','
);
result
+=
')'
;
return
web3
.
sha3
(
result
);
};
module
.
exports
=
{
inputParser
:
inputParser
,
outputParser
:
outputParser
outputParser
:
outputParser
,
methodSignature
:
methodSignature
};
},{}],
2
:[
function
(
require
,
module
,
exports
){
...
...
@@ -418,8 +430,10 @@ var contract = function (address, desc) {
call
:
function
(
extra
)
{
extra
=
extra
||
{};
extra
.
to
=
address
;
extra
.
data
=
parsed
;
return
web3
.
eth
.
call
(
extra
).
then
(
onSuccess
);
return
abi
.
methodSignature
(
desc
,
method
.
name
).
then
(
function
(
signature
)
{
extra
.
data
=
signature
.
slice
(
0
,
10
)
+
parsed
;
return
web3
.
eth
.
call
(
extra
).
then
(
onSuccess
);
});
},
transact
:
function
(
extra
)
{
extra
=
extra
||
{};
...
...
dist/ethereum.js.map
View file @
0538c115
This diff is collapsed.
Click to expand it.
dist/ethereum.min.js
View file @
0538c115
This diff is collapsed.
Click to expand it.
lib/abi.js
View file @
0538c115
...
...
@@ -140,7 +140,6 @@ var toAbiInput = function (json, methodName, params) {
return
;
}
bytes
=
"0x"
+
padLeft
(
index
.
toString
(
16
),
2
);
var
method
=
json
[
index
];
for
(
var
i
=
0
;
i
<
method
.
inputs
.
length
;
i
++
)
{
...
...
@@ -259,7 +258,20 @@ var outputParser = function (json) {
return
parser
;
};
var
methodSignature
=
function
(
json
,
name
)
{
var
method
=
json
[
findMethodIndex
(
json
,
name
)];
var
result
=
name
+
'('
;
var
inputTypes
=
method
.
inputs
.
map
(
function
(
inp
)
{
return
inp
.
type
;
});
result
+=
inputTypes
.
join
(
','
);
result
+=
')'
;
return
web3
.
sha3
(
result
);
};
module
.
exports
=
{
inputParser
:
inputParser
,
outputParser
:
outputParser
outputParser
:
outputParser
,
methodSignature
:
methodSignature
};
lib/contract.js
View file @
0538c115
...
...
@@ -46,8 +46,10 @@ var contract = function (address, desc) {
call
:
function
(
extra
)
{
extra
=
extra
||
{};
extra
.
to
=
address
;
extra
.
data
=
parsed
;
return
web3
.
eth
.
call
(
extra
).
then
(
onSuccess
);
return
abi
.
methodSignature
(
desc
,
method
.
name
).
then
(
function
(
signature
)
{
extra
.
data
=
signature
.
slice
(
0
,
10
)
+
parsed
;
return
web3
.
eth
.
call
(
extra
).
then
(
onSuccess
);
});
},
transact
:
function
(
extra
)
{
extra
=
extra
||
{};
...
...
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