use alloc::vec::Vec;
use miden_protocol::Word;
use miden_protocol::account::AccountComponent;
mod allow_all;
mod owner_only;
pub use allow_all::BurnAllowAll;
pub use owner_only::BurnOwnerOnly;
#[derive(Debug, Clone, Copy, Default)]
pub enum BurnPolicyConfig {
#[default]
AllowAll,
OwnerOnly,
Custom(Word),
}
impl BurnPolicyConfig {
pub fn root(self) -> Word {
match self {
Self::AllowAll => BurnAllowAll::root().as_word(),
Self::OwnerOnly => BurnOwnerOnly::root().as_word(),
Self::Custom(root) => root,
}
}
pub(crate) fn into_components(self) -> Vec<AccountComponent> {
match self {
Self::AllowAll => vec![BurnAllowAll.into()],
Self::OwnerOnly => vec![BurnOwnerOnly.into()],
Self::Custom(_) => Vec::new(),
}
}
}