mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 22:59:58 -07:00
brk: first commit
This commit is contained in:
28
_src/structs/tx_data.rs
Normal file
28
_src/structs/tx_data.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user