Skip to content

Commit

Permalink
add trace option
Browse files Browse the repository at this point in the history
  • Loading branch information
Zergity committed Dec 13, 2024
1 parent d5fa3e9 commit 3d6036e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libs/AssistedJsonRpcProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ class AssistedJsonRpcProvider extends Provider {
filter.toBlock - filter.fromBlock >
this.etherscanConfig.rangeThreshold
const orMode = isOrMode(filter.topics)
if (this.etherscanConfig.trace) {
console.log('AssistedJsonRpcProvider.getLogs', { scanMode, orMode })
}
if (!orMode) {
if (scanMode) {
return this.getLogsByApi(filter);
Expand Down Expand Up @@ -160,6 +163,9 @@ class AssistedJsonRpcProvider extends Provider {
return logs
}
getLogsByRpc(filter) {
if (this.etherscanConfig.trace) {
console.log('AssistedJsonRpcProvider.getLogsByRpc', filter)
}
if (this.web3) {
return this.web3.eth.getPastLogs(filter);
}
Expand Down Expand Up @@ -212,6 +218,9 @@ class AssistedJsonRpcProvider extends Provider {
fromBlock,
});

if (this.etherscanConfig.trace) {
console.log('AssistedJsonRpcProvider.scanLogs', url)
}
let logs = await this.search(url);

if (logs.length < this.etherscanConfig.maxResults) {
Expand Down
1 change: 1 addition & 0 deletions libs/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ function standardizeStartConfiguration(config) {
}

const knownProps = [
'trace',
'rangeThreshold',
'rateLimitCount',
'rateLimitDuration',
Expand Down

0 comments on commit 3d6036e

Please sign in to comment.