parent
e0e4acea68
commit
98db35e81f
@ -0,0 +1,40 @@ |
|||||||
|
|
||||||
|
# See http://help.github.com/ignore-files/ for more about ignoring files. |
||||||
|
|
||||||
|
# compiled output |
||||||
|
/dist |
||||||
|
/tmp |
||||||
|
/out-tsc |
||||||
|
|
||||||
|
# dependencies |
||||||
|
/node_modules |
||||||
|
|
||||||
|
# IDEs and editors |
||||||
|
/.idea |
||||||
|
.project |
||||||
|
.classpath |
||||||
|
.c9/ |
||||||
|
*.launch |
||||||
|
.settings/ |
||||||
|
*.sublime-workspace |
||||||
|
|
||||||
|
# IDE - VSCode |
||||||
|
.vscode/* |
||||||
|
!.vscode/settings.json |
||||||
|
!.vscode/tasks.json |
||||||
|
!.vscode/launch.json |
||||||
|
!.vscode/extensions.json |
||||||
|
|
||||||
|
# misc |
||||||
|
/.sass-cache |
||||||
|
/connect.lock |
||||||
|
/coverage |
||||||
|
/libpeerconnection.log |
||||||
|
npm-debug.log |
||||||
|
yarn-error.log |
||||||
|
testem.log |
||||||
|
/typings |
||||||
|
|
||||||
|
# System Files |
||||||
|
.DS_Store |
||||||
|
Thumbs.db |
@ -1,61 +1,62 @@ |
|||||||
|
class Filters {
|
||||||
const Filters = function (executionContext) { |
constructor(executionContext) { |
||||||
this.executionContext = executionContext |
this.executionContext = executionContext |
||||||
} |
} |
||||||
|
|
||||||
Filters.prototype.methods = function () { |
methods () { |
||||||
return { |
return { |
||||||
eth_getLogs: this.eth_getLogs.bind(this), |
eth_getLogs: this.eth_getLogs.bind(this), |
||||||
eth_subscribe: this.eth_subscribe.bind(this), |
eth_subscribe: this.eth_subscribe.bind(this), |
||||||
eth_unsubscribe: this.eth_unsubscribe.bind(this) |
eth_unsubscribe: this.eth_unsubscribe.bind(this) |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
Filters.prototype.eth_getLogs = function (payload, cb) { |
eth_getLogs (payload, cb) { |
||||||
let results = this.executionContext.logsManager.getLogsFor(payload.params[0]) |
let results = this.executionContext.logsManager.getLogsFor(payload.params[0]) |
||||||
cb(null, results) |
cb(null, results) |
||||||
} |
} |
||||||
|
|
||||||
Filters.prototype.eth_subscribe = function (payload, cb) { |
eth_subscribe (payload, cb) { |
||||||
let subscriptionId = this.executionContext.logsManager.subscribe(payload.params) |
let subscriptionId = this.executionContext.logsManager.subscribe(payload.params) |
||||||
cb(null, subscriptionId) |
cb(null, subscriptionId) |
||||||
} |
} |
||||||
|
|
||||||
Filters.prototype.eth_unsubscribe = function (payload, cb) { |
eth_unsubscribe (payload, cb) { |
||||||
this.executionContext.logsManager.unsubscribe(payload.params[0]) |
this.executionContext.logsManager.unsubscribe(payload.params[0]) |
||||||
cb(null, true) |
cb(null, true) |
||||||
} |
} |
||||||
|
|
||||||
Filters.prototype.eth_newFilter = function (payload, cb) { |
eth_newFilter (payload, cb) { |
||||||
const filterId = this.executionContext.logsManager.newFilter('filter', payload.params[0]) |
const filterId = this.executionContext.logsManager.newFilter('filter', payload.params[0]) |
||||||
cb(null, filterId) |
cb(null, filterId) |
||||||
} |
} |
||||||
|
|
||||||
Filters.prototype.eth_newBlockFilter = function (payload, cb) { |
eth_newBlockFilter (payload, cb) { |
||||||
const filterId = this.executionContext.logsManager.newFilter('block') |
const filterId = this.executionContext.logsManager.newFilter('block') |
||||||
cb(null, filterId) |
cb(null, filterId) |
||||||
} |
} |
||||||
|
|
||||||
Filters.prototype.eth_newPendingTransactionFilter = function (payload, cb) { |
eth_newPendingTransactionFilter (payload, cb) { |
||||||
const filterId = this.executionContext.logsManager.newFilter('pendingTransactions') |
const filterId = this.executionContext.logsManager.newFilter('pendingTransactions') |
||||||
cb(null, filterId) |
cb(null, filterId) |
||||||
} |
} |
||||||
|
|
||||||
Filters.prototype.eth_uninstallfilter = function (payload, cb) { |
eth_uninstallfilter (payload, cb) { |
||||||
const result = this.executionContext.logsManager.uninstallFilter(payload.params[0]) |
const result = this.executionContext.logsManager.uninstallFilter(payload.params[0]) |
||||||
cb(null, result) |
cb(null, result) |
||||||
} |
} |
||||||
|
|
||||||
Filters.prototype.eth_getFilterChanges = function (payload, cb) { |
eth_getFilterChanges (payload, cb) { |
||||||
const filterId = payload.params[0] |
const filterId = payload.params[0] |
||||||
let results = this.executionContext.logsManager.getLogsForFilter(filterId) |
let results = this.executionContext.logsManager.getLogsForFilter(filterId) |
||||||
cb(null, results) |
cb(null, results) |
||||||
} |
} |
||||||
|
|
||||||
Filters.prototype.eth_getFilterLogs = function (payload, cb) { |
eth_getFilterLogs (payload, cb) { |
||||||
const filterId = payload.params[0] |
const filterId = payload.params[0] |
||||||
let results = this.executionContext.logsManager.getLogsForFilter(filterId, true) |
let results = this.executionContext.logsManager.getLogsForFilter(filterId, true) |
||||||
cb(null, results) |
cb(null, results) |
||||||
|
} |
||||||
} |
} |
||||||
|
|
||||||
module.exports = Filters |
module.exports = Filters |
Loading…
Reference in new issue