Skip to content

Commit 0fdac51

Browse files
authored
feat(sdk): return checkpoint height with AddressSyncResult (#2965)
1 parent 632b3f1 commit 0fdac51

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

packages/rs-sdk/src/platform/address_sync/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ pub async fn sync_address_balances<P: AddressProvider>(
115115

116116
// Step 1: Execute trunk query
117117
let (trunk_result, checkpoint_height) = execute_trunk_query(sdk, &mut result.metrics).await?;
118+
result.checkpoint_height = checkpoint_height;
118119

119120
trace!(
120121
"Trunk query returned {} elements, {} leaf_keys",

packages/rs-sdk/src/platform/address_sync/types.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ pub struct AddressSyncResult {
7474

7575
/// Metrics about the sync process.
7676
pub metrics: AddressSyncMetrics,
77+
78+
/// The checkpoint height at which balances were synced.
79+
///
80+
/// This is the block height from which terminal balance updates should start
81+
/// to catch any changes that occurred after the checkpoint.
82+
pub checkpoint_height: u64,
7783
}
7884

7985
impl AddressSyncResult {
@@ -84,6 +90,7 @@ impl AddressSyncResult {
8490
absent: BTreeSet::new(),
8591
highest_found_index: None,
8692
metrics: AddressSyncMetrics::default(),
93+
checkpoint_height: 0,
8794
}
8895
}
8996

0 commit comments

Comments
 (0)