event example
This commit is contained in:
@ -22,7 +22,7 @@
|
||||
|
||||
var web3 = require('./web3');
|
||||
var abi = require('./abi');
|
||||
var eventImplementation = require('./event');
|
||||
var eventImpl = require('./event');
|
||||
|
||||
var addFunctionRelatedPropertiesToContract = function (contract) {
|
||||
|
||||
@ -127,10 +127,18 @@ var addEventsToContract = function (contract, desc, address) {
|
||||
var impl = function () {
|
||||
var params = Array.prototype.slice.call(arguments);
|
||||
var signature = abi.methodSignature(e.name);
|
||||
var eventImpl = eventImplementation(address, signature);
|
||||
var o = eventImpl.apply(null, params);
|
||||
var event = eventImpl(address, signature);
|
||||
var o = event.apply(null, params);
|
||||
return web3.eth.watch(o);
|
||||
};
|
||||
|
||||
impl.address = address;
|
||||
|
||||
Object.defineProperty(impl, 'topics', {
|
||||
get: function() {
|
||||
return [abi.methodSignature(e.name)];
|
||||
}
|
||||
});
|
||||
|
||||
// TODO: rename these methods, cause they are used not only for methods
|
||||
var displayName = abi.methodDisplayName(e.name);
|
||||
|
Reference in New Issue
Block a user