ProofsTransaction

Trait ProofsTransaction 

Source
pub trait ProofsTransaction<'a> {
    type Err: Into<Error> + From<Error>;

    // Required methods
    fn add_proofs<'life0, 'async_trait>(
        &'life0 mut self,
        proof: Proofs,
        quote_id: Option<QuoteId>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_proofs_states<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        ys: &'life1 [PublicKey],
        proofs_state: State,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<State>>, Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn remove_proofs<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        ys: &'life1 [PublicKey],
        quote_id: Option<QuoteId>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_proof_ys_by_quote_id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        quote_id: &'life1 QuoteId,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<PublicKey>, Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Mint Proof Transaction trait

Required Associated Types§

Source

type Err: Into<Error> + From<Error>

Mint Proof Database Error

Required Methods§

Source

fn add_proofs<'life0, 'async_trait>( &'life0 mut self, proof: Proofs, quote_id: Option<QuoteId>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add Proofs

Adds proofs to the database. The database should error if the proof already exits, with a AttemptUpdateSpentProof if the proof is already spent or a Duplicate error otherwise.

Source

fn update_proofs_states<'life0, 'life1, 'async_trait>( &'life0 mut self, ys: &'life1 [PublicKey], proofs_state: State, ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<State>>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Updates the proofs to a given states and return the previous states

Source

fn remove_proofs<'life0, 'life1, 'async_trait>( &'life0 mut self, ys: &'life1 [PublicKey], quote_id: Option<QuoteId>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove Proofs

Source

fn get_proof_ys_by_quote_id<'life0, 'life1, 'async_trait>( &'life0 self, quote_id: &'life1 QuoteId, ) -> Pin<Box<dyn Future<Output = Result<Vec<PublicKey>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get ys by quote id

Implementors§