solidity methods "overloading"
This commit is contained in:
@ -53,12 +53,16 @@ var contract = function (address, desc) {
|
||||
var contract = {};
|
||||
|
||||
desc.forEach(function (method) {
|
||||
contract[method.name] = function () {
|
||||
|
||||
var displayName = abi.methodDisplayName(method.name);
|
||||
var typeName = abi.methodTypeName(method.name);
|
||||
|
||||
var impl = function () {
|
||||
var params = Array.prototype.slice.call(arguments);
|
||||
var parsed = inputParser[method.name].apply(null, params);
|
||||
var parsed = inputParser[displayName][typeName].apply(null, params);
|
||||
|
||||
var onSuccess = function (result) {
|
||||
return outputParser[method.name](result);
|
||||
return outputParser[displayName][typeName](result);
|
||||
};
|
||||
|
||||
return {
|
||||
@ -80,6 +84,12 @@ var contract = function (address, desc) {
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
if (contract[displayName] === undefined) {
|
||||
contract[displayName] = impl;
|
||||
}
|
||||
|
||||
contract[displayName][typeName] = impl;
|
||||
});
|
||||
|
||||
return contract;
|
||||
|
Reference in New Issue
Block a user