File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/common/execution-provider Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -57,10 +57,10 @@ export class ExecutionProviderService {
57
57
blockStep = this . configService . get ( 'EL_BLOCK_STEP' ) ,
58
58
) : Promise < Log [ ] > {
59
59
let logs : Log [ ] = [ ] ;
60
- const latestBlock = await this . provider . getBlockNumber ( ) ;
61
-
62
- const fromBlock = Number ( filter . fromBlock ) ?? 0 ;
63
- const toBlock = typeof filter . toBlock === 'string ' ? latestBlock : Number ( filter . toBlock ) ;
60
+ const toBlock =
61
+ typeof filter . toBlock === 'number' ? filter . toBlock : ( await this . provider . getBlock ( filter . toBlock ) ) . number ;
62
+ const fromBlock =
63
+ typeof filter . fromBlock === 'number ' ? filter . fromBlock : ( await this . provider . getBlock ( filter . fromBlock ) ) . number ;
64
64
65
65
for ( let startBlock = fromBlock ; startBlock <= toBlock ; startBlock += blockStep ) {
66
66
const endBlock = Math . min ( startBlock + blockStep - 1 , toBlock ) ;
You can’t perform that action at this time.
0 commit comments