anya_core/layer2/mock/
mod.rs

1use crate::layer2::{
2    AssetParams, AssetTransfer, Layer2Protocol, Proof, ProtocolState, TransactionStatus,
3    TransferResult, ValidationResult, VerificationResult,
4};
5use async_trait::async_trait;
6use mockall::{mock, predicate::*};
7
8mock! {
9    pub Layer2Protocol {}
10
11    #[async_trait]
12    impl Layer2Protocol for Layer2Protocol {
13        async fn initialize(&self) -> Result<(), Box<dyn std::error::Error + Send + Sync>>;
14        async fn connect(&self) -> Result<(), Box<dyn std::error::Error + Send + Sync>>;
15        async fn get_state(&self) -> Result<ProtocolState, Box<dyn std::error::Error + Send + Sync>>;
16        async fn submit_transaction(&self, tx_data: &[u8]) -> Result<String, Box<dyn std::error::Error + Send + Sync>>;
17        async fn check_transaction_status(&self, tx_id: &str) -> Result<TransactionStatus, Box<dyn std::error::Error + Send + Sync>>;
18        async fn sync_state(&mut self) -> Result<(), Box<dyn std::error::Error + Send + Sync>>;
19        async fn issue_asset(&self, params: AssetParams) -> Result<String, Box<dyn std::error::Error + Send + Sync>>;
20        async fn transfer_asset(&self, transfer: AssetTransfer) -> Result<TransferResult, Box<dyn std::error::Error + Send + Sync>>;
21        async fn verify_proof(&self, proof: Proof) -> Result<VerificationResult, Box<dyn std::error::Error + Send + Sync>>;
22        async fn validate_state(&self, state_data: &[u8]) -> Result<ValidationResult, Box<dyn std::error::Error + Send + Sync>>;
23    }
24}