TransactionExecutor

Trait TransactionExecutor 

Source
pub trait TransactionExecutor: Send + Sync {
    // Required methods
    fn execute_transaction<'life0, 'async_trait>(
        &'life0 self,
        request: ExecuteTransactionRequestV1,
        client_addr: Option<SocketAddr>,
    ) -> Pin<Box<dyn Future<Output = Result<ExecuteTransactionResponseV1, QuorumDriverError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn simulate_transaction(
        &self,
        transaction: TransactionData,
        checks: VmChecks,
    ) -> Result<SimulateTransactionResult, IotaError>;
    fn wait_for_checkpoint_inclusion<'life0, 'life1, 'async_trait>(
        &'life0 self,
        digests: &'life1 [TransactionDigest],
        timeout: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<TransactionDigest, (CheckpointSequenceNumber, u64)>, IotaError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait to define the interface for how the REST service interacts with a QuorumDriver or a simulated transaction executor.

Required Methods§

Source

fn execute_transaction<'life0, 'async_trait>( &'life0 self, request: ExecuteTransactionRequestV1, client_addr: Option<SocketAddr>, ) -> Pin<Box<dyn Future<Output = Result<ExecuteTransactionResponseV1, QuorumDriverError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn simulate_transaction( &self, transaction: TransactionData, checks: VmChecks, ) -> Result<SimulateTransactionResult, IotaError>

Source

fn wait_for_checkpoint_inclusion<'life0, 'life1, 'async_trait>( &'life0 self, digests: &'life1 [TransactionDigest], timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<BTreeMap<TransactionDigest, (CheckpointSequenceNumber, u64)>, IotaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Wait for the given transactions to be included in a checkpoint.

Returns a mapping from transaction digest to (checkpoint_sequence_number, checkpoint_timestamp_ms). On timeout, returns partial results for any transactions that were already checkpointed.

Implementors§