aboutsummaryrefslogtreecommitdiffstats
path: root/lib/abi.js
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/abi.js
parentd99fea2db682c454581e1f9f60b2cea27d02c36e (diff)
downloadgo-tangerine-0e67fcd361ea1681f989077969417e166ea8453e.tar.gz
go-tangerine-0e67fcd361ea1681f989077969417e166ea8453e.tar.zst
go-tangerine-0e67fcd361ea1681f989077969417e166ea8453e.zip
contract object
Diffstat (limited to 'lib/abi.js')
-rw-r--r--lib/abi.js15
1 files changed, 12 insertions, 3 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;
+