Skip to content

Commit

Permalink
refactor: migrate to the latest miden-base
Browse files Browse the repository at this point in the history
  • Loading branch information
polydez committed Jul 2, 2024
1 parent d9b7f0d commit f1e295f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 5 additions & 15 deletions crates/block-producer/src/batch_builder/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,10 @@ impl TransactionBatch {
}
}
// Check unauthenticated input notes for duplicates:
for note in tx.input_notes().iter() {
// Header is presented only for unauthenticated notes.
if let Some(header) = note.header() {
let id = header.id();
if !unauthenticated_input_notes.insert(id) {
return Err(BuildBatchError::DuplicateUnauthenticatedNote(id, txs.clone()));
}
for note in tx.get_unauthenticated_notes() {
let id = note.id();
if !unauthenticated_input_notes.insert(id) {
return Err(BuildBatchError::DuplicateUnauthenticatedNote(id, txs.clone()));
}
}
}
Expand All @@ -90,14 +87,7 @@ impl TransactionBatch {
let id = input_note_header.id();
if let Some(output_note) = output_notes.remove(&id) {
let input_hash = input_note_header.hash();

// TODO: substitute with just next line once [OutputNote::hash] is implemented
// let output_hash = output_note.hash();
let OutputNote::Header(output_header) = output_note.shrink() else {
unreachable!()
};
let output_hash = output_header.hash();

let output_hash = output_note.hash();
if output_hash != input_hash {
return Err(BuildBatchError::NoteHashesMismatch {
id,
Expand Down

0 comments on commit f1e295f

Please sign in to comment.