Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit cb607b4

Browse files
committed
changes to make whisper working
1 parent 31c6159 commit cb607b4

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

httprpc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
var self = this;
4949
this.sendRequest(payload, function (request) {
5050
var parsed = JSON.parse(request.responseText);
51-
if (!parsed.result) {
51+
if (parsed.result instanceof Array ? parsed.result.length === 0 : !parsed.result) {
5252
return;
5353
}
5454
self.handlers.forEach(function (handler) {

main.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@
131131
}).then(function (request) {
132132
return new Promise(function (resolve, reject) {
133133
web3.provider.send(request, function (result) {
134-
if (result) {
134+
if (result || typeof result === "boolean") {
135135
resolve(result);
136-
} else {
137-
reject(result);
138-
}
136+
return;
137+
}
138+
reject(result);
139139
});
140140
});
141141
}).catch(function( err) {
@@ -373,6 +373,10 @@
373373
});
374374
};
375375

376+
Filter.prototype.arrived = function(callback) {
377+
this.changed(callback);
378+
}
379+
376380
Filter.prototype.changed = function(callback) {
377381
var self = this;
378382
this.promise.then(function(id) {

0 commit comments

Comments
 (0)