pub struct MockXandApiClient {
pub submits: Mock<(Address, XandTransaction), Result<Vec<Result<TransactionUpdate, XandApiClientError>>, XandApiClientError>>,
pub balance: Mock<String, Result<Option<u128>, XandApiClientError>>,
pub pending_create_requests: Mock<(), Result<Paginated<Vec<PendingCreateRequest>>, XandApiClientError>>,
pub pending_redeem_requests: Mock<(), Result<Paginated<Vec<PendingRedeemRequest>>, XandApiClientError>>,
pub transaction_details: Mock<TransactionId, Result<Transaction, XandApiClientError>>,
pub total_issuance: Mock<(), Result<TotalIssuance, XandApiClientError>>,
pub delay: Option<Duration>,
}
Fields§
§submits: Mock<(Address, XandTransaction), Result<Vec<Result<TransactionUpdate, XandApiClientError>>, XandApiClientError>>
§balance: Mock<String, Result<Option<u128>, XandApiClientError>>
§pending_create_requests: Mock<(), Result<Paginated<Vec<PendingCreateRequest>>, XandApiClientError>>
§pending_redeem_requests: Mock<(), Result<Paginated<Vec<PendingRedeemRequest>>, XandApiClientError>>
§transaction_details: Mock<TransactionId, Result<Transaction, XandApiClientError>>
§total_issuance: Mock<(), Result<TotalIssuance, XandApiClientError>>
§delay: Option<Duration>
Implementations§
Source§impl MockXandApiClient
impl MockXandApiClient
pub fn with_delay(self, delay: Duration) -> Self
Trait Implementations§
Source§impl Clone for MockXandApiClient
impl Clone for MockXandApiClient
Source§fn clone(&self) -> MockXandApiClient
fn clone(&self) -> MockXandApiClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for MockXandApiClient
impl Default for MockXandApiClient
Source§impl XandApiClientTrait for MockXandApiClient
impl XandApiClientTrait for MockXandApiClient
Source§fn submit_transaction<'life0, 'async_trait>(
&'life0 self,
address: Address,
txn: XandTransaction,
) -> Pin<Box<dyn Future<Output = Result<TransactionStatusStream, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_transaction<'life0, 'async_trait>(
&'life0 self,
address: Address,
txn: XandTransaction,
) -> Pin<Box<dyn Future<Output = Result<TransactionStatusStream, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submit a transaction to the API, where it will be signed and then sent to the blockchain Read more
Source§fn get_transaction_details<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TransactionId,
) -> Pin<Box<dyn Future<Output = Result<Transaction, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_transaction_details<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TransactionId,
) -> Pin<Box<dyn Future<Output = Result<Transaction, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch the details of a particular transaction
Source§fn get_transaction_history<'life0, 'life1, 'async_trait>(
&'life0 self,
_paging: Option<Paging>,
_filter: &'life1 TransactionFilter,
) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<Transaction>>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_transaction_history<'life0, 'life1, 'async_trait>(
&'life0 self,
_paging: Option<Paging>,
_filter: &'life1 TransactionFilter,
) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<Transaction>>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query transaction history
Source§fn get_balance<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<u128>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_balance<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<u128>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch the balance (in USD cents) held by an address Read more
fn get_total_issuance<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<TotalIssuance, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_address_transactions<'life0, 'life1, 'async_trait>(
&'life0 self,
_address: &'life1 str,
_paging: Option<Paging>,
) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<Transaction>>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_address_transactions<'life0, 'life1, 'async_trait>(
&'life0 self,
_address: &'life1 str,
_paging: Option<Paging>,
) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<Transaction>>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch all transactions which are relevant to the provided address
Source§fn get_current_block<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Blockstamp, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_current_block<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Blockstamp, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the most current block and timestamp with a staleness indicator
Source§fn get_pending_create_requests<'life0, 'async_trait>(
&'life0 self,
_paging: Option<Paging>,
) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<PendingCreateRequest>>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_pending_create_requests<'life0, 'async_trait>(
&'life0 self,
_paging: Option<Paging>,
) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<PendingCreateRequest>>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request the current pending create requests
Source§fn get_pending_redeem_requests<'life0, 'async_trait>(
&'life0 self,
_paging: Option<Paging>,
) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<PendingRedeemRequest>>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_pending_redeem_requests<'life0, 'async_trait>(
&'life0 self,
_paging: Option<Paging>,
) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<PendingRedeemRequest>>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request the current pending redeem requests
Source§fn propose_action<'life0, 'async_trait>(
&'life0 self,
_issuer: Address,
_admin_txn: AdministrativeTransaction,
) -> Pin<Box<dyn Future<Output = Result<TransactionStatusStream, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn propose_action<'life0, 'async_trait>(
&'life0 self,
_issuer: Address,
_admin_txn: AdministrativeTransaction,
) -> Pin<Box<dyn Future<Output = Result<TransactionStatusStream, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submit a proposal for an action to be voted on by network
Source§fn vote_on_proposal<'life0, 'async_trait>(
&'life0 self,
_issuer: Address,
_vote_proposal: VoteProposal,
) -> Pin<Box<dyn Future<Output = Result<TransactionStatusStream, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn vote_on_proposal<'life0, 'async_trait>(
&'life0 self,
_issuer: Address,
_vote_proposal: VoteProposal,
) -> Pin<Box<dyn Future<Output = Result<TransactionStatusStream, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submit vote on specific proposal by id
Source§fn get_proposal<'life0, 'async_trait>(
&'life0 self,
_id: u32,
) -> Pin<Box<dyn Future<Output = Result<Proposal, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_proposal<'life0, 'async_trait>(
&'life0 self,
_id: u32,
) -> Pin<Box<dyn Future<Output = Result<Proposal, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get specific proposal by id
Source§fn get_all_proposals<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Proposal>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_proposals<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Proposal>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all non-expired proposals
Source§fn get_members<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Address>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_members<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Address>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get list of members
Get list of validators
Source§fn get_trustee<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Address, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_trustee<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Address, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get trustee address
Source§fn get_allowlist<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Address, CidrBlock)>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_allowlist<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Address, CidrBlock)>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get allowlisted CIDR blocks per address
Source§fn get_limited_agent<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Address>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_limited_agent<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Address>, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get Limited Agent address if one exists
Source§fn get_validator_emission_rate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ValidatorEmissionRate, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_validator_emission_rate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ValidatorEmissionRate, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get current Validator emission rate setting
Source§fn get_validator_emission_progress<'life0, 'async_trait>(
&'life0 self,
_address: Address,
) -> Pin<Box<dyn Future<Output = Result<ValidatorEmissionProgress, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_validator_emission_progress<'life0, 'async_trait>(
&'life0 self,
_address: Address,
) -> Pin<Box<dyn Future<Output = Result<ValidatorEmissionProgress, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the current progress of an individual validator toward an emission
Source§fn get_pending_create_request_expire_time<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_pending_create_request_expire_time<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the current pending create request expire time in milliseconds
Source§fn check_health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HealthResponse, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check_health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HealthResponse, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Health check
Source§fn submit_transaction_wait<'life0, 'async_trait>(
&'life0 self,
issuer: Address,
txn: XandTransaction,
) -> Pin<Box<dyn Future<Output = Result<TransactionUpdate, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_transaction_wait<'life0, 'async_trait>(
&'life0 self,
issuer: Address,
txn: XandTransaction,
) -> Pin<Box<dyn Future<Output = Result<TransactionUpdate, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Like
submit_transaction
, but rather than returning a stream, returns a future that
completes once the the transaction has been committed or invalidated (not finalized).Source§fn submit_transaction_wait_final<'life0, 'async_trait>(
&'life0 self,
issuer: Address,
txn: XandTransaction,
) -> Pin<Box<dyn Future<Output = Result<TransactionUpdate, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_transaction_wait_final<'life0, 'async_trait>(
&'life0 self,
issuer: Address,
txn: XandTransaction,
) -> Pin<Box<dyn Future<Output = Result<TransactionUpdate, XandApiClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submits a transaction and returns its final status (which, in the case of a valid
transaction, should eventually be
Finalized
). Read moreSource§fn with_timeout(self, timeout: Duration) -> WithTimeout<Self>where
Self: Sized,
fn with_timeout(self, timeout: Duration) -> WithTimeout<Self>where
Self: Sized,
Returns a client that behaves like
self
and applies the given timeout to every
asynchronous operation.Auto Trait Implementations§
impl Freeze for MockXandApiClient
impl RefUnwindSafe for MockXandApiClient
impl Send for MockXandApiClient
impl Sync for MockXandApiClient
impl Unpin for MockXandApiClient
impl UnwindSafe for MockXandApiClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request