aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarek Kotewicz <marek.kotewicz@gmail.com>2014-11-13 19:24:34 +0800
committerMarek Kotewicz <marek.kotewicz@gmail.com>2014-11-13 19:24:34 +0800
commit0e67fcd361ea1681f989077969417e166ea8453e (patch)
tree29b8ef683fe7784b9e2507f9c239dd43be93bcaa /lib
parentd99fea2db682c454581e1f9f60b2cea27d02c36e (diff)
downloadgo-tangerine-0e67fcd361ea1681f989077969417e166ea8453e.tar
go-tangerine-0e67fcd361ea1681f989077969417e166ea8453e.tar.gz
go-tangerine-0e67fcd361ea1681f989077969417e166ea8453e.tar.bz2
go-tangerine-0e67fcd361ea1681f989077969417e166ea8453e.tar.lz
go-tangerine-0e67fcd361ea1681f989077969417e166ea8453e.tar.xz
go-tangerine-0e67fcd361ea1681f989077969417e166ea8453e.tar.zst
go-tangerine-0e67fcd361ea1681f989077969417e166ea8453e.zip
contract object
Diffstat (limited to 'lib')
-rw-r--r--lib/abi.js15
-rw-r--r--lib/main.js4
2 files changed, 13 insertions, 6 deletions
diff --git a/lib/abi.js b/lib/abi.js
index 0ac27e6b8..1e3759918 100644
--- a/lib/abi.js
+++ b/lib/abi.js
@@ -148,8 +148,17 @@ var fromAbiOutput = function (json, methodName, output) {
return result;
};
-module.exports = {
- toAbiInput: toAbiInput,
- fromAbiOutput: fromAbiOutput
+var load = function (json) {
+ var contract = {};
+ json.forEach(function (method) {
+ contract[method.name] = function () {
+ var params = Array.prototype.slice.call(arguments);
+ return toAbiInput(json, method.name, params);
+ };
+ });
+
+ return contract;
};
+module.exports = load;
+
diff --git a/lib/main.js b/lib/main.js
index d7f8531d2..fc0170287 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -86,9 +86,7 @@ var ethMethods = function () {
{ name: 'uncle', call: uncleCall },
{ name: 'compilers', call: 'eth_compilers' },
{ name: 'lll', call: 'eth_lll' },
- { name: 'solidity', call: 'eth_solidity' },
- { name: 'contractCreate', call: 'eth_contractCreate' },
- { name: 'contractCall', call: 'eth_contractCall' }
+ { name: 'solidity', call: 'eth_solidity' }
];
return methods;
};