crate::weight::Weight;
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum OutputType {
P2Pkh,
P2Sh,
SegWitV0 { ty: SegWitV0Type, nested: bool },
Taproot,
}
impl OutputType {
pub(crate) fn output_only_weight(&self) -> Weight {
use OutputType::*;
match self {
P2Pkh => Weight::from_non_witness_data_size(1 + 1 + 1 + 160 / 8 + 1 + 1 ),
P2Sh => Weight::from_non_witness_data_size(1 + 1 + 160 / 8 + 1 ),
SegWitV0 { ty: _, nested: true } => Weight::from_non_witness_data_size(1 + 1 + 160 / 8 + 1 ),
SegWitV0 { ty: SegWitV0Type::Pubkey, nested: false } => Weight::from_non_witness_data_size(1 + 1 + 160 / 8 ),
SegWitV0 { ty: SegWitV0Type::Script, nested: false } => Weight::from_non_witness_data_size(1 + 1 + 256 / 8 ),
Taproot => Weight::from_non_witness_data_size(1 + 1 + 256 / 8 ),
}
}
}