use amplify::confinement::SmallOrdSet;
use bp::Tx;
use super::TerminalSeal;
use crate::LIB_NAME_RGB_STD;
#[derive(Clone, Eq, PartialEq, Debug)]
#[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)]
#[strict_type(lib = LIB_NAME_RGB_STD)]
#[cfg_attr(
feature = "serde",
derive(Serialize, Deserialize),
serde(crate = "serde_crate", rename_all = "camelCase")
)]
pub struct Terminal {
pub seals: SmallOrdSet<TerminalSeal>,
pub tx: Option<Tx>,
}
impl Terminal {
pub fn new(seal: TerminalSeal) -> Self {
Terminal {
seals: small_bset![seal],
tx: None,
}
}
pub fn with(seal: TerminalSeal, tx: Tx) -> Self {
Terminal {
seals: small_bset![seal],
tx: Some(tx),
}
}
}
#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display, Default)]
#[derive(StrictType, StrictEncode, StrictDecode)]
#[strict_type(lib = LIB_NAME_RGB_STD, tags = repr, into_u8, try_from_u8)]
#[cfg_attr(
feature = "serde",
derive(Serialize, Deserialize),
serde(crate = "serde_crate", rename_all = "camelCase")
)]
#[display(lowercase)]
#[non_exhaustive]
#[repr(u8)]
pub enum ContainerVer {
#[default]
V1 = 1,
}