Skip to content

Commit

Permalink
ledger rpc U64 change
Browse files Browse the repository at this point in the history
  • Loading branch information
exeokan committed Jan 28, 2025
1 parent af85eae commit bb7dd2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ edition = "2021"
resolver = "2"

[dependencies]
alloy-primitives = { version = "0.8.12", default-features = false, features = ["serde"] }
anyhow = { version = "1.0.68", default-features = false, features = ["std"] }
async-trait = "0.1.71"
bitcoin = { version = "0.32.2", features = ["serde", "rand"] }
Expand Down
7 changes: 5 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::time::{Duration, SystemTime};

use alloy_primitives::U64;
use anyhow::{bail, Result};
use jsonrpsee::{
core::client::ClientT,
Expand Down Expand Up @@ -44,14 +45,16 @@ impl Client {
Ok(self
.client
.request("ledger_getLastScannedL1Height", rpc_params![])
.await?)
.await
.map(|v: U64| v.try_into().expect("U64 to u64 must succeed"))?)
}

pub async fn ledger_get_head_soft_confirmation_height(&self) -> Result<u64> {
Ok(self
.client
.request("ledger_getHeadSoftConfirmationHeight", rpc_params![])
.await?)
.await
.map(|v: U64| v.try_into().expect("U64 to u64 must succeed"))?)
}

pub async fn wait_for_l2_block(&self, num: u64, timeout: Option<Duration>) -> Result<()> {
Expand Down

0 comments on commit bb7dd2f

Please sign in to comment.