Skip to content

Commit

Permalink
Fix after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
tomyrd committed Jun 14, 2024
1 parent 979b509 commit 9769be1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
9 changes: 7 additions & 2 deletions src/client/notes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,13 @@ impl<N: NodeRpcClient, R: FeltRng, S: Store, A: TransactionAuthenticator> Client

// Add the inclusion proof to the imported note
info!("Requesting MMR data for past block num {}", inclusion_details.block_num);
let block_header =
self.get_and_store_authenticated_block(inclusion_details.block_num).await?;
let mut current_partial_mmr = self.build_current_partial_mmr(true)?;
let block_header = self
.get_and_store_authenticated_block(
inclusion_details.block_num,
&mut current_partial_mmr,
)
.await?;
let inclusion_proof = NoteInclusionProof::new(
inclusion_details.block_num,
block_header.sub_hash(),
Expand Down
12 changes: 9 additions & 3 deletions src/client/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ impl<N: NodeRpcClient, R: FeltRng, S: Store, A: TransactionAuthenticator> Client
self.update_mmr_data().await?;

let ignored_notes_sync = self.update_ignored_notes().await?;
total_sync_details.combine_with(&ignored_notes_sync);
total_sync_summary.combine_with(&ignored_notes_sync);

return Ok(total_sync_summary);
}
Expand All @@ -258,7 +258,9 @@ impl<N: NodeRpcClient, R: FeltRng, S: Store, A: TransactionAuthenticator> Client
.expect("Commited notes should have inclusion proofs")
.origin()
.block_num;
self.get_and_store_authenticated_block(block_num).await?;
let mut current_partial_mmr = self.build_current_partial_mmr(true)?;
self.get_and_store_authenticated_block(block_num, &mut current_partial_mmr)
.await?;
}

Ok(())
Expand All @@ -276,8 +278,12 @@ impl<N: NodeRpcClient, R: FeltRng, S: Store, A: TransactionAuthenticator> Client
let updated_notes = note_details.len();

for details in note_details {
let mut current_partial_mmr = self.build_current_partial_mmr(true)?;
let note_block = self
.get_and_store_authenticated_block(details.inclusion_details().block_num)
.get_and_store_authenticated_block(
details.inclusion_details().block_num,
&mut current_partial_mmr,
)
.await?;

let note_inclusion_proof = NoteInclusionProof::new(
Expand Down

0 comments on commit 9769be1

Please sign in to comment.