Skip to content

Commit

Permalink
fix: debug client etherscan (#13542)
Browse files Browse the repository at this point in the history
Signed-off-by: Gregory Edison <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>
  • Loading branch information
greged93 and mattsse authored Dec 25, 2024
1 parent 00c8ec7 commit 3fbb230
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/consensus/debug-client/src/providers/etherscan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ impl EtherscanBlockProvider {
/// `BlockNumberOrTag::Earliest`, `BlockNumberOrTag::Pending`, `BlockNumberOrTag::Number(u64)`
/// are supported.
pub async fn load_block(&self, block_number_or_tag: BlockNumberOrTag) -> eyre::Result<Block> {
let tag = match block_number_or_tag {
BlockNumberOrTag::Number(num) => format!("{num:#02x}"),
tag => tag.to_string(),
};
let block: EtherscanBlockResponse = self
.http_client
.get(&self.base_url)
.query(&[
("module", "proxy"),
("action", "eth_getBlockByNumber"),
("tag", &block_number_or_tag.to_string()),
("tag", &tag),
("boolean", "true"),
("apikey", &self.api_key),
])
Expand Down

0 comments on commit 3fbb230

Please sign in to comment.