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
27a8799e
Commit
27a8799e
authored
Nov 17, 2014
by
Marek Kotewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added eth_serpent, contract separated to another file
parent
f6ee8e52
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
81 additions
and
48 deletions
+81
-48
ethereum.js
dist/ethereum.js
+8
-6
ethereum.js.map
dist/ethereum.js.map
+5
-3
ethereum.min.js
dist/ethereum.min.js
+1
-1
index.js
index.js
+1
-0
index_qt.js
index_qt.js
+1
-0
contract.js
lib/contract.js
+63
-0
main.js
lib/main.js
+2
-38
No files found.
dist/ethereum.js
View file @
27a8799e
This diff is collapsed.
Click to expand it.
dist/ethereum.js.map
View file @
27a8799e
This diff is collapsed.
Click to expand it.
dist/ethereum.min.js
View file @
27a8799e
This diff is collapsed.
Click to expand it.
index.js
View file @
27a8799e
...
...
@@ -3,5 +3,6 @@ web3.providers.WebSocketProvider = require('./lib/websocket');
web3
.
providers
.
HttpRpcProvider
=
require
(
'./lib/httprpc'
);
web3
.
providers
.
QtProvider
=
require
(
'./lib/qt'
);
web3
.
providers
.
AutoProvider
=
require
(
'./lib/autoprovider'
);
web3
.
contract
=
require
(
'./lib/contract'
);
module
.
exports
=
web3
;
index_qt.js
View file @
27a8799e
var
web3
=
require
(
'./lib/main'
);
web3
.
providers
.
QtProvider
=
require
(
'./lib/qt'
);
web3
.
contract
=
require
(
'./lib/contract'
);
module
.
exports
=
web3
;
lib/contract.js
0 → 100644
View file @
27a8799e
/*
This file is part of ethereum.js.
ethereum.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ethereum.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with ethereum.js. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file contract.js
* @authors:
* Marek Kotewicz <marek@ethdev.com>
* @date 2014
*/
if
(
process
.
env
.
NODE_ENV
!==
'build'
)
{
var
web3
=
require
(
'./web3'
);
// jshint ignore:line
}
var
abi
=
require
(
'./abi'
);
var
contract
=
function
(
address
,
desc
)
{
var
inputParser
=
abi
.
inputParser
(
desc
);
var
outputParser
=
abi
.
outputParser
(
desc
);
var
contract
=
{};
desc
.
forEach
(
function
(
method
)
{
contract
[
method
.
name
]
=
function
()
{
var
params
=
Array
.
prototype
.
slice
.
call
(
arguments
);
var
parsed
=
inputParser
[
method
.
name
].
apply
(
null
,
params
);
var
onSuccess
=
function
(
result
)
{
return
outputParser
[
method
.
name
](
result
);
};
return
{
call
:
function
(
extra
)
{
extra
=
extra
||
{};
extra
.
to
=
address
;
extra
.
data
=
parsed
;
return
web3
.
eth
.
call
(
extra
).
then
(
onSuccess
);
},
transact
:
function
(
extra
)
{
extra
=
extra
||
{};
extra
.
to
=
address
;
extra
.
data
=
parsed
;
return
web3
.
eth
.
transact
(
extra
).
then
(
onSuccess
);
}
};
};
});
return
contract
;
};
module
.
exports
=
contract
;
lib/main.js
View file @
27a8799e
...
...
@@ -22,8 +22,6 @@
* @date 2014
*/
var
abi
=
require
(
'./abi'
);
function
flattenPromise
(
obj
)
{
if
(
obj
instanceof
Promise
)
{
return
Promise
.
resolve
(
obj
);
...
...
@@ -89,7 +87,8 @@ var ethMethods = function () {
{
name
:
'uncle'
,
call
:
uncleCall
},
{
name
:
'compilers'
,
call
:
'eth_compilers'
},
{
name
:
'lll'
,
call
:
'eth_lll'
},
{
name
:
'solidity'
,
call
:
'eth_solidity'
}
{
name
:
'solidity'
,
call
:
'eth_solidity'
},
{
name
:
'serpent'
,
call
:
'eth_serpent'
}
];
return
methods
;
};
...
...
@@ -455,40 +454,5 @@ function messageHandler(data) {
}
}
web3
.
contract
=
function
(
address
,
desc
)
{
var
inputParser
=
abi
.
inputParser
(
desc
);
var
outputParser
=
abi
.
outputParser
(
desc
);
var
contract
=
{};
desc
.
forEach
(
function
(
method
)
{
contract
[
method
.
name
]
=
function
()
{
var
params
=
Array
.
prototype
.
slice
.
call
(
arguments
);
var
parsed
=
inputParser
[
method
.
name
].
apply
(
null
,
params
);
var
onSuccess
=
function
(
result
)
{
return
outputParser
[
method
.
name
](
result
);
};
return
{
call
:
function
(
extra
)
{
extra
=
extra
||
{};
extra
.
to
=
address
;
extra
.
data
=
parsed
;
return
web3
.
eth
.
call
(
extra
).
then
(
onSuccess
);
},
transact
:
function
(
extra
)
{
extra
=
extra
||
{};
extra
.
to
=
address
;
extra
.
data
=
parsed
;
return
web3
.
eth
.
transact
(
extra
).
then
(
onSuccess
);
}
};
};
});
return
contract
;
};
module
.
exports
=
web3
;
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