Compare commits

...

1 Commits

Author SHA1 Message Date
Matthias Seitz
54c2cd753e fix(rpc): simplify error wrapping in AtBlockHash filter path
Remove unnecessary explicit EthFilterError::from() wrapper — the ? operator
handles the ProviderError -> EthFilterError conversion automatically, matching
the pattern used in logs_for_filter.

Amp-Thread-ID: https://ampcode.com/threads/T-019c6cb6-ceab-7265-8c51-f3362d304da9
Co-authored-by: Amp <amp@ampcode.com>
2026-02-17 18:54:50 +01:00

View File

@@ -271,11 +271,15 @@ where
.flatten();
logs_utils::get_filter_block_range(from, to, start_block, info)?
}
FilterBlockOption::AtBlockHash(_) => {
FilterBlockOption::AtBlockHash(block_hash) => {
// blockHash is equivalent to fromBlock = toBlock = the block number with
// hash blockHash
// get_logs_in_block_range is inclusive
(start_block, best_number)
let block_number = self
.provider()
.block_number(block_hash)?
.ok_or(ProviderError::HeaderNotFound(block_hash.into()))?;
(block_number, block_number)
}
};
let logs = self