use crate::fragment::FragmentId;
use crate::value::*;
pub type TransactionIndex = u8;
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct UtxoPointer {
pub transaction_id: FragmentId,
pub output_index: TransactionIndex,
pub value: Value,
}
impl UtxoPointer {
pub fn new(transaction_id: FragmentId, output_index: TransactionIndex, value: Value) -> Self {
UtxoPointer {
transaction_id,
output_index,
value,
}
}
}
impl std::fmt::Display for UtxoPointer {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(
f,
"{}@{}.{}",
self.transaction_id, self.output_index, self.value
)
}
}