Struct saito_rust::block::Block [−][src]
pub struct Block {
pub has_golden_ticket: bool,
pub has_issuance_transaction: bool,
pub issuance_transaction_idx: u64,
pub slips_spent_this_block: AHashMap<SaitoUTXOSetKey, u64>,
// some fields omitted
}
Fields
has_golden_ticket: bool
has_issuance_transaction: bool
issuance_transaction_idx: u64
slips_spent_this_block: AHashMap<SaitoUTXOSetKey, u64>
Implementations
pub fn get_transactions(&self) -> &Vec<Transaction>ⓘ
pub fn serialize_for_hash(&self) -> Vec<u8>ⓘ
pub fn serialize_for_signature(&self) -> Vec<u8>ⓘ
Serialize a Block for transport or disk. [len of transactions - 4 bytes - u32] [id - 8 bytes - u64] [timestamp - 8 bytes - u64] [previous_block_hash - 32 bytes - SHA 256 hash] [creator - 33 bytes - Secp25k1 pubkey compact format] [merkle_root - 32 bytes - SHA 256 hash [signature - 64 bytes - Secp25k1 sig] [treasury - 8 bytes - u64] [staking_treasury - 8 bytes - u64] [burnfee - 8 bytes - u64] [difficulty - 8 bytes - u64] [transaction][transaction][transaction]…
Deserialize from bytes to a Block. [len of transactions - 4 bytes - u32] [id - 8 bytes - u64] [timestamp - 8 bytes - u64] [previous_block_hash - 32 bytes - SHA 256 hash] [creator - 33 bytes - Secp25k1 pubkey compact format] [merkle_root - 32 bytes - SHA 256 hash [signature - 64 bytes - Secp25k1 sig] [treasury - 8 bytes - u64] [staking_treasury - 8 bytes - u64] [burnfee - 8 bytes - u64] [difficulty - 8 bytes - u64] [transaction][transaction][transaction]…
pub fn on_chain_reorganization(
&self,
utxoset: &mut AHashMap<SaitoUTXOSetKey, u64>,
longest_chain: bool
) -> bool
pub async fn validate(
&self,
blockchain: &Blockchain,
utxoset: &AHashMap<SaitoUTXOSetKey, u64>,
staking: &Staking
) -> bool
pub async fn generate(
transactions: &mut Vec<Transaction>,
previous_block_hash: SaitoHash,
wallet_lock: Arc<RwLock<Wallet>>,
blockchain_lock: Arc<RwLock<Blockchain>>,
current_timestamp: u64
) -> Block
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Block
impl UnwindSafe for Block
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more