Commit 51684554 authored by Alex Beregszaszi's avatar Alex Beregszaszi

Use ethereumjs-abi for encoding requests

parent f738864d
......@@ -274,8 +274,12 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
$instance.append(self.getCallButton({
abi: funABI,
encode: function (args) {
var obj = web3contract.at('0x00')[funABI.name];
return obj.getData.apply(obj, args);
var types = [];
for (var i = 0; i < funABI.inputs.length; i++) {
types.push(funABI.inputs[i].type);
}
return Buffer.concat([ ethJSABI.methodID(funABI.name, types), ethJSABI.rawEncode(types, args) ]).toString('hex');
},
address: address
}));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment