aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarek Kotewicz <marek.kotewicz@gmail.com>2015-01-31 11:09:48 +0800
committerMarek Kotewicz <marek.kotewicz@gmail.com>2015-01-31 11:09:48 +0800
commit0b82a05a75a0a7592e4fe391120f90d7cee495ac (patch)
treea4f308fe78c57d8118e91bda2d640f70ee135f23 /lib
parent80c97ca21b168e7f94cae6333be5439b6db2fe1d (diff)
downloaddexon-0b82a05a75a0a7592e4fe391120f90d7cee495ac.tar
dexon-0b82a05a75a0a7592e4fe391120f90d7cee495ac.tar.gz
dexon-0b82a05a75a0a7592e4fe391120f90d7cee495ac.tar.bz2
dexon-0b82a05a75a0a7592e4fe391120f90d7cee495ac.tar.lz
dexon-0b82a05a75a0a7592e4fe391120f90d7cee495ac.tar.xz
dexon-0b82a05a75a0a7592e4fe391120f90d7cee495ac.tar.zst
dexon-0b82a05a75a0a7592e4fe391120f90d7cee495ac.zip
events
Diffstat (limited to 'lib')
-rw-r--r--lib/filter.js6
-rw-r--r--lib/web3.js8
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/filter.js b/lib/filter.js
index d97276f78..4cb297f37 100644
--- a/lib/filter.js
+++ b/lib/filter.js
@@ -28,11 +28,9 @@ var web3 = require('./web3'); // jshint ignore:line
/// should be used when we want to watch something
/// it's using inner polling mechanism and is notified about changes
/// TODO: change 'options' name cause it may be not the best matching one, since we have events
-var Filter = function(options, indexed, impl) {
+var Filter = function(options, impl) {
- if (options._isEvent) {
- return options(indexed);
- } else if (typeof options !== "string") {
+ if (typeof options !== "string") {
// topics property is deprecated, warn about it!
if (options.topics) {
diff --git a/lib/web3.js b/lib/web3.js
index 6bf8f7bc0..88dc6931b 100644
--- a/lib/web3.js
+++ b/lib/web3.js
@@ -282,7 +282,10 @@ var web3 = {
/// @param filter may be a string, object or event
/// @param indexed is optional, this may be an object with optional event indexed params
watch: function (filter, indexed) {
- return new web3.filter(filter, indexed, ethWatch);
+ if (filter._isEvent) {
+ return filter(indexed);
+ }
+ return new web3.filter(filter, ethWatch);
}
},
@@ -293,9 +296,8 @@ var web3 = {
shh: {
/// @param filter may be a string, object or event
- /// @param indexed is optional, this may be an object with optional event indexed params
watch: function (filter, indexed) {
- return new web3.filter(filter, indexed, shhWatch);
+ return new web3.filter(filter, shhWatch);
}
},