Trait Owner

Source
pub trait Owner: Clone + NamedEntity {
    // Required methods
    fn handle_duty<'life0, 'life1, 'async_trait>(
        &'life0 self,
        dbtx: DatabaseTransaction<'life1>,
        duty: Duty,
    ) -> Pin<Box<dyn Future<Output = Result<DutyResult, BridgeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn create_txhandlers<'life0, 'life1, 'async_trait>(
        &'life0 self,
        dbtx: DatabaseTransaction<'life1>,
        tx_type: TransactionType,
        contract_context: ContractContext,
    ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<TransactionType, TxHandler>, BridgeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn handle_finalized_block<'life0, 'life1, 'async_trait>(
        &'life0 self,
        dbtx: DatabaseTransaction<'life1>,
        block_id: u32,
        block_height: u32,
        block_cache: Arc<BlockCache>,
        _light_client_proof_wait_interval_secs: Option<u32>,
    ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn is_kickoff_relevant_for_owner(&self, _kickoff_data: &KickoffData) -> bool { ... }
}
Expand description

Owner trait with async handling and tx handler creation

Required Methods§

Source

fn handle_duty<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: DatabaseTransaction<'life1>, duty: Duty, ) -> Pin<Box<dyn Future<Output = Result<DutyResult, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Handle a protocol-related duty

Source

fn create_txhandlers<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: DatabaseTransaction<'life1>, tx_type: TransactionType, contract_context: ContractContext, ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<TransactionType, TxHandler>, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create the transactions for an instance of the L1 contract

Source

fn handle_finalized_block<'life0, 'life1, 'async_trait>( &'life0 self, dbtx: DatabaseTransaction<'life1>, block_id: u32, block_height: u32, block_cache: Arc<BlockCache>, _light_client_proof_wait_interval_secs: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Handle a new finalized block

Provided Methods§

Source

fn is_kickoff_relevant_for_owner(&self, _kickoff_data: &KickoffData) -> bool

Check if a kickoff is relevant for the owner For verifiers, all kickoffs are relevant For operators, only kickoffs of their own are relevant, which will be checked by a trait fn override

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<C> Owner for Operator<C>
where C: CitreaClientT,

Source§

impl<C> Owner for Verifier<C>
where C: CitreaClientT,