pub struct ZeldProtocol { /* private fields */ }Expand description
Entry point used to process blocks according to the ZELD protocol.
Implementations§
Source§impl ZeldProtocol
impl ZeldProtocol
Sourcepub fn new(config: ZeldConfig) -> Self
pub fn new(config: ZeldConfig) -> Self
Creates a new protocol instance with the given configuration.
Sourcepub fn config(&self) -> &ZeldConfig
pub fn config(&self) -> &ZeldConfig
Returns a reference to the protocol configuration.
Sourcepub fn pre_process_block(&self, block: &Block) -> PreProcessedZeldBlock
pub fn pre_process_block(&self, block: &Block) -> PreProcessedZeldBlock
Pre-processes a Bitcoin block, extracting all ZELD-relevant data.
This phase is parallelizable — you can pre-process multiple blocks concurrently.
The returned PreProcessedZeldBlock contains all transactions with their computed rewards
and distribution hints.
Sourcepub fn process_block<S>(
&self,
block: &PreProcessedZeldBlock,
store: &mut S,
) -> ProcessedZeldBlockwhere
S: ZeldStore,
pub fn process_block<S>(
&self,
block: &PreProcessedZeldBlock,
store: &mut S,
) -> ProcessedZeldBlockwhere
S: ZeldStore,
Processes a pre-processed block, updating ZELD balances in the store.
This phase is sequential — blocks must be processed in order, one after another. For each transaction, this method:
- Collects ZELD from spent inputs
- Applies rewards and distributions to outputs
- Updates the store with new balances
Returns a ProcessedZeldBlock containing all rewards and block statistics.
Trait Implementations§
Source§impl Clone for ZeldProtocol
impl Clone for ZeldProtocol
Source§fn clone(&self) -> ZeldProtocol
fn clone(&self) -> ZeldProtocol
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ZeldProtocol
impl Debug for ZeldProtocol
Source§impl Default for ZeldProtocol
impl Default for ZeldProtocol
Source§fn default() -> ZeldProtocol
fn default() -> ZeldProtocol
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ZeldProtocol
impl RefUnwindSafe for ZeldProtocol
impl Send for ZeldProtocol
impl Sync for ZeldProtocol
impl Unpin for ZeldProtocol
impl UnwindSafe for ZeldProtocol
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more