mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-25 07:09:59 -07:00
29 lines
582 B
Rust
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
|
|
}
|
|
}
|