simplified polling && jsonrpc payload creation
This commit is contained in:
10
lib/web3.js
10
lib/web3.js
@ -136,8 +136,8 @@ var setupMethods = function (obj, methods) {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
var call = typeof method.call === 'function' ? method.call(args) : method.call;
|
||||
return web3.provider.send({
|
||||
call: call,
|
||||
args: args
|
||||
method: call,
|
||||
params: args
|
||||
});
|
||||
};
|
||||
});
|
||||
@ -150,15 +150,15 @@ var setupProperties = function (obj, properties) {
|
||||
var proto = {};
|
||||
proto.get = function () {
|
||||
return web3.provider.send({
|
||||
call: property.getter
|
||||
method: property.getter
|
||||
});
|
||||
};
|
||||
|
||||
if (property.setter) {
|
||||
proto.set = function (val) {
|
||||
return web3.provider.send({
|
||||
call: property.setter,
|
||||
args: [val]
|
||||
method: property.setter,
|
||||
params: [val]
|
||||
});
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user