aboutsummaryrefslogtreecommitdiffstats
path: root/lib/contract.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/contract.js')
-rw-r--r--lib/contract.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/contract.js b/lib/contract.js
index 58a67efe6..13c48ca10 100644
--- a/lib/contract.js
+++ b/lib/contract.js
@@ -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);