Skip to content

Commit

Permalink
Accept block hashes for eth_getCode
Browse files Browse the repository at this point in the history
  • Loading branch information
incrypto32 committed Mar 11, 2024
1 parent cf77031 commit 6fa509d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ impl<T: Transport> Eth<T> {
}

/// Get code under given address
pub fn code(&self, address: Address, block: Option<BlockNumber>) -> CallFuture<Bytes, T::Out> {
pub fn code(&self, address: Address, block: Option<BlockId>) -> CallFuture<Bytes, T::Out> {
let address = helpers::serialize(&address);
let block = helpers::serialize(&block.unwrap_or(BlockNumber::Latest));
let block = helpers::serialize(&block.unwrap_or_else(|| BlockNumber::Latest.into()));

CallFuture::new(self.transport.execute("eth_getCode", vec![address, block]))
}
Expand Down

0 comments on commit 6fa509d

Please sign in to comment.