Commit 2e64ca7e authored by Iuri Matias's avatar Iuri Matias

implement eth_getFilterLogs

parent 299b25b8
...@@ -73,6 +73,13 @@ class LogsManager { ...@@ -73,6 +73,13 @@ class LogsManager {
return matchedSubscriptions return matchedSubscriptions
} }
getLogsForSubscription(subscriptionId) {
const subscriptionParams = this.subscriptions[subscriptionId]
const [_queryType, queryFilter] = subscriptionParams
return this.getLogsFor(queryFilter);
}
transmit (result) { transmit (result) {
this.notificationCallbacks.forEach((callback) => { this.notificationCallbacks.forEach((callback) => {
if (result.params.result.raw) { if (result.params.result.raw) {
......
...@@ -45,7 +45,7 @@ Implemented: ...@@ -45,7 +45,7 @@ Implemented:
* [_] eth_newPendingTransactionFilter * [_] eth_newPendingTransactionFilter
* [_] eth_uninstallFilter * [_] eth_uninstallFilter
* [_] eth_getFilterChanges * [_] eth_getFilterChanges
* [_] eth_getFilterLogs * [X] eth_getFilterLogs
* [X] eth_getLogs * [X] eth_getLogs
* [_] eth_getWork * [_] eth_getWork
* [_] eth_submitWork * [_] eth_submitWork
......
...@@ -13,7 +13,12 @@ Filters.prototype.methods = function () { ...@@ -13,7 +13,12 @@ Filters.prototype.methods = function () {
} }
} }
// https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getlogs Filters.prototype.eth_getFilterLogs = function (payload, cb) {
let subscriptionId = payload.params[0];
let results = executionContext.logsManager.getLogsForSubscription(subscriptionId)
cb(null, results)
}
Filters.prototype.eth_getLogs = function (payload, cb) { Filters.prototype.eth_getLogs = function (payload, cb) {
let results = executionContext.logsManager.getLogsFor(payload.params[0]) let results = executionContext.logsManager.getLogsFor(payload.params[0])
cb(null, results) cb(null, results)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment