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
b3eda29f
Commit
b3eda29f
authored
Jan 09, 2015
by
Marek Kotewicz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into tests
parents
c397e350
a5907a82
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
15 deletions
+45
-15
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
web3.js
lib/web3.js
+2
-1
websocket.js
lib/websocket.js
+2
-1
package.json
package.json
+1
-1
No files found.
dist/ethereum.js
View file @
b3eda29f
...
@@ -141,7 +141,6 @@ var toAbiInput = function (json, methodName, params) {
...
@@ -141,7 +141,6 @@ var toAbiInput = function (json, methodName, params) {
return
;
return
;
}
}
bytes
=
"0x"
+
padLeft
(
index
.
toString
(
16
),
2
);
var
method
=
json
[
index
];
var
method
=
json
[
index
];
for
(
var
i
=
0
;
i
<
method
.
inputs
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
method
.
inputs
.
length
;
i
++
)
{
...
@@ -260,9 +259,22 @@ var outputParser = function (json) {
...
@@ -260,9 +259,22 @@ var outputParser = function (json) {
return
parser
;
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
=
{
module
.
exports
=
{
inputParser
:
inputParser
,
inputParser
:
inputParser
,
outputParser
:
outputParser
outputParser
:
outputParser
,
methodSignature
:
methodSignature
};
};
},{}],
2
:[
function
(
require
,
module
,
exports
){
},{}],
2
:[
function
(
require
,
module
,
exports
){
...
@@ -418,8 +430,10 @@ var contract = function (address, desc) {
...
@@ -418,8 +430,10 @@ var contract = function (address, desc) {
call
:
function
(
extra
)
{
call
:
function
(
extra
)
{
extra
=
extra
||
{};
extra
=
extra
||
{};
extra
.
to
=
address
;
extra
.
to
=
address
;
extra
.
data
=
parsed
;
return
abi
.
methodSignature
(
desc
,
method
.
name
).
then
(
function
(
signature
)
{
return
web3
.
eth
.
call
(
extra
).
then
(
onSuccess
);
extra
.
data
=
signature
.
slice
(
0
,
10
)
+
parsed
;
return
web3
.
eth
.
call
(
extra
).
then
(
onSuccess
);
});
},
},
transact
:
function
(
extra
)
{
transact
:
function
(
extra
)
{
extra
=
extra
||
{};
extra
=
extra
||
{};
...
...
dist/ethereum.js.map
View file @
b3eda29f
This diff is collapsed.
Click to expand it.
dist/ethereum.min.js
View file @
b3eda29f
This diff is collapsed.
Click to expand it.
lib/abi.js
View file @
b3eda29f
...
@@ -140,7 +140,6 @@ var toAbiInput = function (json, methodName, params) {
...
@@ -140,7 +140,6 @@ var toAbiInput = function (json, methodName, params) {
return
;
return
;
}
}
bytes
=
"0x"
+
padLeft
(
index
.
toString
(
16
),
2
);
var
method
=
json
[
index
];
var
method
=
json
[
index
];
for
(
var
i
=
0
;
i
<
method
.
inputs
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
method
.
inputs
.
length
;
i
++
)
{
...
@@ -259,8 +258,21 @@ var outputParser = function (json) {
...
@@ -259,8 +258,21 @@ var outputParser = function (json) {
return
parser
;
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
=
{
module
.
exports
=
{
inputParser
:
inputParser
,
inputParser
:
inputParser
,
outputParser
:
outputParser
outputParser
:
outputParser
,
methodSignature
:
methodSignature
};
};
lib/contract.js
View file @
b3eda29f
...
@@ -46,8 +46,10 @@ var contract = function (address, desc) {
...
@@ -46,8 +46,10 @@ var contract = function (address, desc) {
call
:
function
(
extra
)
{
call
:
function
(
extra
)
{
extra
=
extra
||
{};
extra
=
extra
||
{};
extra
.
to
=
address
;
extra
.
to
=
address
;
extra
.
data
=
parsed
;
return
abi
.
methodSignature
(
desc
,
method
.
name
).
then
(
function
(
signature
)
{
return
web3
.
eth
.
call
(
extra
).
then
(
onSuccess
);
extra
.
data
=
signature
.
slice
(
0
,
10
)
+
parsed
;
return
web3
.
eth
.
call
(
extra
).
then
(
onSuccess
);
});
},
},
transact
:
function
(
extra
)
{
transact
:
function
(
extra
)
{
extra
=
extra
||
{};
extra
=
extra
||
{};
...
...
lib/web3.js
View file @
b3eda29f
...
@@ -505,4 +505,5 @@ function messageHandler(data) {
...
@@ -505,4 +505,5 @@ function messageHandler(data) {
}
}
}
}
module
.
exports
=
web3
;
if
(
typeof
(
module
)
!==
"undefined"
)
module
.
exports
=
web3
;
lib/websocket.js
View file @
b3eda29f
...
@@ -74,4 +74,5 @@ Object.defineProperty(WebSocketProvider.prototype, "onmessage", {
...
@@ -74,4 +74,5 @@ Object.defineProperty(WebSocketProvider.prototype, "onmessage", {
set
:
function
(
provider
)
{
this
.
onMessage
(
provider
);
}
set
:
function
(
provider
)
{
this
.
onMessage
(
provider
);
}
});
});
module
.
exports
=
WebSocketProvider
;
if
(
typeof
(
module
)
!==
"undefined"
)
module
.
exports
=
WebSocketProvider
;
package.json
View file @
b3eda29f
{
{
"name"
:
"ethereum.js"
,
"name"
:
"ethereum.js"
,
"namespace"
:
"ethereum"
,
"namespace"
:
"ethereum"
,
"version"
:
"0.0.
6
"
,
"version"
:
"0.0.
7
"
,
"description"
:
"Ethereum Compatible JavaScript API"
,
"description"
:
"Ethereum Compatible JavaScript API"
,
"main"
:
"./index.js"
,
"main"
:
"./index.js"
,
"directories"
:
{
"directories"
:
{
...
...
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