add whisper support

This commit is contained in:
Iuri Matias 2016-10-12 07:59:50 -04:00
parent 0922a234d1
commit a8b9630b99
2 changed files with 8 additions and 8 deletions

View File

@ -265,19 +265,19 @@ var EmbarkJS =
topics: topics topics: topics
}; };
var multiplePromise = function() { var messageEvents = function() {
this.cb = function() {}; this.cb = function() {};
}; };
multiplePromise.prototype.then = function(cb) { messageEvents.prototype.then = function(cb) {
this.cb = cb; this.cb = cb;
}; };
multiplePromise.prototype.error = function(err) { messageEvents.prototype.error = function(err) {
return err; return err;
}; };
var promise = new multiplePromise(); var promise = new messageEvents();
var filter = web3.shh.filter(filterOptions, function(err, result) { var filter = web3.shh.filter(filterOptions, function(err, result) {
var payload = JSON.parse(web3.toAscii(result.payload)); var payload = JSON.parse(web3.toAscii(result.payload));

View File

@ -218,19 +218,19 @@ EmbarkJS.Messages.Whisper.listenTo = function(options) {
topics: topics topics: topics
}; };
var multiplePromise = function() { var messageEvents = function() {
this.cb = function() {}; this.cb = function() {};
}; };
multiplePromise.prototype.then = function(cb) { messageEvents.prototype.then = function(cb) {
this.cb = cb; this.cb = cb;
}; };
multiplePromise.prototype.error = function(err) { messageEvents.prototype.error = function(err) {
return err; return err;
}; };
var promise = new multiplePromise(); var promise = new messageEvents();
var filter = web3.shh.filter(filterOptions, function(err, result) { var filter = web3.shh.filter(filterOptions, function(err, result) {
var payload = JSON.parse(web3.toAscii(result.payload)); var payload = JSON.parse(web3.toAscii(result.payload));