use miden_protocol::block::BlockNumber;
use miden_protocol::note::NoteId;
use crate::store::StoreError;
use crate::transaction::TransactionStoreUpdateError;
#[derive(Debug, thiserror::Error)]
pub enum BatchBuilderError {
#[error("input note {0} is already consumed by an earlier transaction in this batch")]
DuplicateInputNote(NoteId),
#[error("batch is empty — push at least one transaction before submitting")]
Empty,
#[error(
"batch was accepted at block {block_num} but building store updates failed; sync_state to reconcile"
)]
BatchSubmittedButUpdateBuildFailed {
block_num: BlockNumber,
#[source]
source: TransactionStoreUpdateError,
},
#[error(
"batch was accepted at block {block_num} but applying to the store failed; sync_state to reconcile"
)]
BatchSubmittedButApplyFailed {
block_num: BlockNumber,
#[source]
source: StoreError,
},
}