Files
brk/_src/structs/tx_data.rs
2025-02-23 01:25:15 +01:00

29 lines
582 B
Rust

use allocative::Allocative;
use snkrj::{direct_repr, Storable, UnsizedStorable};
use super::BlockPath;
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Allocative)]
pub struct TxData {
pub index: u32,
pub block_path: BlockPath,
pub utxos: u16,
}
direct_repr!(TxData);
impl TxData {
#[inline(always)]
pub fn new(index: u32, block_path: BlockPath, utxos: u16) -> Self {
Self {
index,
block_path,
utxos,
}
}
#[inline(always)]
pub fn is_empty(&self) -> bool {
self.utxos == 0
}
}