Skip to content

Commit d2163ba

Browse files
Add input and output note counts
Address more review comments Minor cleanup
1 parent 5fd8454 commit d2163ba

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

crates/block-producer/src/domain/transaction.rs

+8
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@ impl AuthenticatedTransaction {
9999
self.inner.output_notes().iter().map(|note| note.id())
100100
}
101101

102+
pub fn output_note_count(&self) -> usize {
103+
self.inner.output_notes().num_notes()
104+
}
105+
106+
pub fn input_note_count(&self) -> usize {
107+
self.inner.input_notes().num_notes()
108+
}
109+
102110
/// Notes which were unauthenticate in the transaction __and__ which were
103111
/// not authenticated by the store inputs.
104112
pub fn unauthenticated_notes(&self) -> impl Iterator<Item = NoteId> + '_ {

crates/block-producer/src/mempool/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,8 @@ impl BatchBudget {
136136
let _: miden_objects::accounts::AccountId = tx.account_update().account_id();
137137
const ACCOUNT_UPDATES_PER_TX: usize = 1;
138138

139-
// TODO: This is inefficient and ProvenTransaction should provide len() access.
140-
let output_notes = tx.output_notes().count();
141-
let input_notes = tx.nullifiers().count();
139+
let output_notes = tx.output_note_count();
140+
let input_notes = tx.input_note_count();
142141

143142
if self.transactions == 0
144143
|| self.accounts < ACCOUNT_UPDATES_PER_TX

0 commit comments

Comments
 (0)