RedeemRequestRepository

Trait RedeemRequestRepository 

Source
pub trait RedeemRequestRepository {
    type Utxo: IUtxo;
    type Iter: Iterator<Item = (CorrelationId, RedeemRequestRecord<Self::Utxo>)>;

    // Required methods
    fn get_unfulfilled_redeem_request(
        &self,
        correlation_id: CorrelationId,
    ) -> Option<RedeemRequestRecord<Self::Utxo>>;
    fn store_redeem_request(
        &self,
        correlation_id: CorrelationId,
        record: RedeemRequestRecord<Self::Utxo>,
    );
    fn remove_redeem_request(&self, correlation_id: CorrelationId);
    fn all_unfulfilled_redeem_requests(&self) -> Self::Iter;
}
Expand description

Provides access to and storage of info in the ledger about pending unfulfilled redeem requests in the form of RedeemRequestRecords

Required Associated Types§

Source

type Utxo: IUtxo

Source

type Iter: Iterator<Item = (CorrelationId, RedeemRequestRecord<Self::Utxo>)>

The type of iterator the implementor uses

Required Methods§

Source

fn get_unfulfilled_redeem_request( &self, correlation_id: CorrelationId, ) -> Option<RedeemRequestRecord<Self::Utxo>>

Fetches the redeem request record for the correlation id if one exists

Source

fn store_redeem_request( &self, correlation_id: CorrelationId, record: RedeemRequestRecord<Self::Utxo>, )

Stores a new unfulfilled redeem request record under the provided correlation id

Source

fn remove_redeem_request(&self, correlation_id: CorrelationId)

Remove an unfulfilled redeem request record from storage - either because of fulfillment or cancellation.

Source

fn all_unfulfilled_redeem_requests(&self) -> Self::Iter

Returns an iterator over all outstanding unfulfilled redeem requests

Implementors§