fix(accounts): not use magic numbers for rpc.BlockNumber (#2016)

This commit is contained in:
Daniel Liu 2026-02-05 14:23:11 +08:00 committed by GitHub
parent 44b4a51ed4
commit 798b0cdf2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -830,11 +830,11 @@ func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.Filter
filter = b.filterSystem.NewBlockFilter(*query.BlockHash, query.Addresses, query.Topics)
} else {
// Initialize unset filter boundaried to run from genesis to chain head
from := int64(0)
from := rpc.EarliestBlockNumber.Int64()
if query.FromBlock != nil {
from = query.FromBlock.Int64()
}
to := int64(-1)
to := rpc.LatestBlockNumber.Int64()
if query.ToBlock != nil {
to = query.ToBlock.Int64()
}