Skip to content

Commit bf61c23

Browse files
feat: add get_current_partial_mmr as a client method (0xMiden#1466)
1 parent bc187dc commit bf61c23

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

crates/rust-client/src/sync/block_header.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ impl<AUTH> Client<AUTH> {
3939
Ok(genesis_block)
4040
}
4141

42+
/// Fetches from the store the current view of the chain's [`PartialMmr`].
43+
pub async fn get_current_partial_mmr(&self) -> Result<PartialMmr, ClientError> {
44+
self.store.get_current_partial_mmr().await.map_err(Into::into)
45+
}
46+
4247
// HELPERS
4348
// --------------------------------------------------------------------------------------------
4449

crates/rust-client/src/sync/state_sync.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ pub trait OnNoteReceived {
6565
///
6666
/// When created it receives a callback that will be executed when a new note inclusion is received
6767
/// in the sync response.
68+
#[derive(Clone)]
6869
pub struct StateSync {
6970
/// The RPC client used to communicate with the node.
7071
rpc_api: Arc<dyn NodeRpcClient>,
@@ -123,7 +124,7 @@ impl StateSync {
123124
/// * `unspent_input_notes` - The current state of unspent input notes tracked by the client.
124125
/// * `unspent_output_notes` - The current state of unspent output notes tracked by the client.
125126
pub async fn sync_state(
126-
self,
127+
&self,
127128
mut current_partial_mmr: PartialMmr,
128129
accounts: Vec<AccountHeader>,
129130
note_tags: BTreeSet<NoteTag>,

0 commit comments

Comments
 (0)