Trait TransactionExecutor

Source
pub trait TransactionExecutor {
    // Required methods
    fn redeem_ticket<'life0, 'async_trait>(
        &'life0 self,
        ticket: RedeemableTicket,
    ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn fund_channel<'life0, 'async_trait>(
        &'life0 self,
        destination: Address,
        balance: HoprBalance,
    ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn initiate_outgoing_channel_closure<'life0, 'async_trait>(
        &'life0 self,
        dst: Address,
    ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn finalize_outgoing_channel_closure<'life0, 'async_trait>(
        &'life0 self,
        dst: Address,
    ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn close_incoming_channel<'life0, 'async_trait>(
        &'life0 self,
        src: Address,
    ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn withdraw<'life0, 'async_trait, C>(
        &'life0 self,
        recipient: Address,
        amount: Balance<C>,
    ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
       where C: 'async_trait + Currency + Send + 'static,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn announce<'life0, 'async_trait>(
        &'life0 self,
        data: AnnouncementData,
    ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn register_safe<'life0, 'async_trait>(
        &'life0 self,
        safe_address: Address,
    ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Implements execution of transactions underlying each Action.

Each operation returns a transaction hash and may time out.

Required Methods§

Source

fn redeem_ticket<'life0, 'async_trait>( &'life0 self, ticket: RedeemableTicket, ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Executes ticket redemption transaction given a ticket.

Source

fn fund_channel<'life0, 'async_trait>( &'life0 self, destination: Address, balance: HoprBalance, ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Executes channel funding transaction (or channel opening) to the given destination and stake. Channel funding and channel opening are both same transactions.

Source

fn initiate_outgoing_channel_closure<'life0, 'async_trait>( &'life0 self, dst: Address, ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Initiates closure of an outgoing channel.

Source

fn finalize_outgoing_channel_closure<'life0, 'async_trait>( &'life0 self, dst: Address, ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Finalizes closure of an outgoing channel.

Source

fn close_incoming_channel<'life0, 'async_trait>( &'life0 self, src: Address, ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Closes incoming channel.

Source

fn withdraw<'life0, 'async_trait, C>( &'life0 self, recipient: Address, amount: Balance<C>, ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
where C: 'async_trait + Currency + Send + 'static, Self: 'async_trait, 'life0: 'async_trait,

Performs withdrawal of a certain amount from an address. Note that this transaction is typically awaited via polling and is not tracked by the Indexer.

Source

fn announce<'life0, 'async_trait>( &'life0 self, data: AnnouncementData, ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Announces the node on-chain given the AnnouncementData

Source

fn register_safe<'life0, 'async_trait>( &'life0 self, safe_address: Address, ) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Registers Safe with the node.

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§