Layer2ProtocolTrait

Trait Layer2ProtocolTrait 

Source
pub trait Layer2ProtocolTrait {
    // Required methods
    fn initialize(&self) -> Result<(), Box<dyn Error + Send + Sync>>;
    fn get_state(&self) -> Result<ProtocolState, Box<dyn Error + Send + Sync>>;
    fn submit_transaction(
        &self,
        tx_data: &[u8],
    ) -> Result<String, Box<dyn Error + Send + Sync>>;
    fn check_transaction_status(
        &self,
        tx_id: &str,
    ) -> Result<TransactionStatus, Box<dyn Error + Send + Sync>>;
    fn sync_state(&mut self) -> Result<(), Box<dyn Error + Send + Sync>>;
    fn issue_asset(
        &self,
        params: AssetParams,
    ) -> Result<String, Box<dyn Error + Send + Sync>>;
    fn transfer_asset(
        &self,
        transfer: AssetTransfer,
    ) -> Result<TransferResult, Box<dyn Error + Send + Sync>>;
    fn verify_proof(
        &self,
        proof: Proof,
    ) -> Result<VerificationResult, Box<dyn Error + Send + Sync>>;
    fn validate_state(
        &self,
        state_data: &[u8],
    ) -> Result<ValidationResult, Box<dyn Error + Send + Sync>>;
}
Expand description

Legacy Layer2 protocol interface for synchronous implementations

Required Methods§

Source

fn initialize(&self) -> Result<(), Box<dyn Error + Send + Sync>>

Source

fn get_state(&self) -> Result<ProtocolState, Box<dyn Error + Send + Sync>>

Source

fn submit_transaction( &self, tx_data: &[u8], ) -> Result<String, Box<dyn Error + Send + Sync>>

Source

fn check_transaction_status( &self, tx_id: &str, ) -> Result<TransactionStatus, Box<dyn Error + Send + Sync>>

Source

fn sync_state(&mut self) -> Result<(), Box<dyn Error + Send + Sync>>

Source

fn issue_asset( &self, params: AssetParams, ) -> Result<String, Box<dyn Error + Send + Sync>>

Source

fn transfer_asset( &self, transfer: AssetTransfer, ) -> Result<TransferResult, Box<dyn Error + Send + Sync>>

Source

fn verify_proof( &self, proof: Proof, ) -> Result<VerificationResult, Box<dyn Error + Send + Sync>>

Source

fn validate_state( &self, state_data: &[u8], ) -> Result<ValidationResult, Box<dyn Error + Send + Sync>>

Implementations on Foreign Types§

Source§

impl<T> Layer2ProtocolTrait for Arc<T>

Source§

fn initialize(&self) -> Result<(), Box<dyn Error + Send + Sync>>

Source§

fn get_state(&self) -> Result<ProtocolState, Box<dyn Error + Send + Sync>>

Source§

fn submit_transaction( &self, tx_data: &[u8], ) -> Result<String, Box<dyn Error + Send + Sync>>

Source§

fn check_transaction_status( &self, tx_id: &str, ) -> Result<TransactionStatus, Box<dyn Error + Send + Sync>>

Source§

fn sync_state(&mut self) -> Result<(), Box<dyn Error + Send + Sync>>

Source§

fn issue_asset( &self, params: AssetParams, ) -> Result<String, Box<dyn Error + Send + Sync>>

Source§

fn transfer_asset( &self, transfer: AssetTransfer, ) -> Result<TransferResult, Box<dyn Error + Send + Sync>>

Source§

fn verify_proof( &self, proof: Proof, ) -> Result<VerificationResult, Box<dyn Error + Send + Sync>>

Source§

fn validate_state( &self, state_data: &[u8], ) -> Result<ValidationResult, Box<dyn Error + Send + Sync>>

Implementors§