implement eth_getFilterLogs

pull/7/head
Iuri Matias 5 years ago
parent 299b25b8c6
commit 2e64ca7e88
  1. 7
      remix-lib/src/execution/logsManager.js
  2. 2
      remix-simulator/README.md
  3. 7
      remix-simulator/src/methods/filters.js

@ -73,6 +73,13 @@ class LogsManager {
return matchedSubscriptions
}
getLogsForSubscription(subscriptionId) {
const subscriptionParams = this.subscriptions[subscriptionId]
const [_queryType, queryFilter] = subscriptionParams
return this.getLogsFor(queryFilter);
}
transmit (result) {
this.notificationCallbacks.forEach((callback) => {
if (result.params.result.raw) {

@ -45,7 +45,7 @@ Implemented:
* [_] eth_newPendingTransactionFilter
* [_] eth_uninstallFilter
* [_] eth_getFilterChanges
* [_] eth_getFilterLogs
* [X] eth_getFilterLogs
* [X] eth_getLogs
* [_] eth_getWork
* [_] eth_submitWork

@ -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) {
let results = executionContext.logsManager.getLogsFor(payload.params[0])
cb(null, results)

Loading…
Cancel
Save