Skip to main content

BlockSource

Trait BlockSource 

Source
pub trait BlockSource: Send + Sync {
    // Required methods
    fn fetch_utxo<'life0, 'life1, 'async_trait>(
        &'life0 self,
        outpoint: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Utxo>, StakeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn current_unix_time<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<u64, StakeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Async surface for fetching Bitcoin chain data. Production wires this to two independent Esplora endpoints and requires agreement; tests pass a hand-rolled mock that returns canned values.

Required Methods§

Source

fn fetch_utxo<'life0, 'life1, 'async_trait>( &'life0 self, outpoint: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Utxo>, StakeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn current_unix_time<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64, StakeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§