Skip to content

Commit

Permalink
feat: Remove compute prefix from batch id constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippGackstatter committed Feb 3, 2025
1 parent d6b041d commit 6869e72
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions crates/miden-objects/src/batch/batch_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ pub struct BatchId(Digest);

impl BatchId {
/// Calculates a batch ID from the given set of transactions.
pub fn compute_from_transactions<'tx, T>(txs: T) -> Self
pub fn from_transactions<'tx, T>(txs: T) -> Self
where
T: Iterator<Item = &'tx ProvenTransaction>,
{
Self::compute_from_ids(txs.map(|tx| (tx.id(), tx.account_id())))
Self::from_ids(txs.map(|tx| (tx.id(), tx.account_id())))
}

/// Calculates a batch ID from the given transaction ID and account ID tuple.
pub fn compute_from_ids(iter: impl Iterator<Item = (TransactionId, AccountId)>) -> Self {
pub fn from_ids(iter: impl Iterator<Item = (TransactionId, AccountId)>) -> Self {
let mut elements: Vec<Felt> = Vec::new();
for (tx_id, account_id) in iter {
elements.extend_from_slice(tx_id.as_elements());
Expand Down
2 changes: 1 addition & 1 deletion crates/miden-objects/src/batch/proposed_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ impl ProposedBatch {
// Compute batch ID.
// --------------------------------------------------------------------------------------------

let id = BatchId::compute_from_transactions(transactions.iter().map(AsRef::as_ref));
let id = BatchId::from_transactions(transactions.iter().map(AsRef::as_ref));

Ok(Self {
id,
Expand Down

0 comments on commit 6869e72

Please sign in to comment.