Skip to content

Commit

Permalink
fix: deserialize block num as U64 (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
onbjerg authored Nov 21, 2023
1 parent 5789288 commit 7862a03
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/providers/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,13 @@ impl<T: Transport + Clone + Send + Sync> TempProvider for Provider<T> {
.await
}

/// Gets the last block number available.
/// Gets the last block number available.
async fn get_block_number(&self) -> TransportResult<u64>
where
Self: Sync,
where
Self: Sync,
{
self.inner.prepare("eth_blockNumber", Cow::<()>::Owned(())).await
self.inner.prepare("eth_blockNumber", Cow::<()>::Owned(())).await.map(|num: U64| num.to::<u64>())
}

/// Gets the balance of the account at the specified tag, which defaults to latest.
Expand Down

0 comments on commit 7862a03

Please sign in to comment.