ScriptHandler

Trait ScriptHandler 

Source
pub trait ScriptHandler: Send + Sync {
    // Required methods
    fn build_transaction(
        &self,
        tx_builder: &mut TransactionBuilder,
        script_group: &mut ScriptGroup,
        context: &dyn HandlerContext,
    ) -> Result<bool, TxBuilderError>;
    fn init(&mut self, network: &NetworkInfo) -> Result<(), TxBuilderError>;
    fn init_async<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        network: &'life1 NetworkInfo,
    ) -> Pin<Box<dyn Future<Output = Result<(), TxBuilderError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn build_transaction( &self, tx_builder: &mut TransactionBuilder, script_group: &mut ScriptGroup, context: &dyn HandlerContext, ) -> Result<bool, TxBuilderError>

Try to build transaction with the given script_group and context.

Return true if script_group and context are matched, otherwise return false.

Source

fn init(&mut self, network: &NetworkInfo) -> Result<(), TxBuilderError>

Source

fn init_async<'life0, 'life1, 'async_trait>( &'life0 mut self, network: &'life1 NetworkInfo, ) -> Pin<Box<dyn Future<Output = Result<(), TxBuilderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§