Skip to content

Commit

Permalink
Accept block hashes for eth_getBalance
Browse files Browse the repository at this point in the history
  • Loading branch information
incrypto32 committed Feb 20, 2024
1 parent 7f8eb6d commit cf77031
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 @@ -108,9 +108,9 @@ impl<T: Transport> Eth<T> {
}

/// Get balance of given address
pub fn balance(&self, address: Address, block: Option<BlockNumber>) -> CallFuture<U256, T::Out> {
pub fn balance(&self, address: Address, block: Option<BlockId>) -> CallFuture<U256, 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_getBalance", vec![address, block]))
}
Expand Down

0 comments on commit cf77031

Please sign in to comment.