pub struct MonerodMockClient;
Expand description
A mocker monerod client. Returns canned responses for testing purposes.
Trait Implementations§
Source§impl Client for MockClient
impl Client for MockClient
Source§async fn block(&self, height: u64) -> Result<(Hash, Block), RpcError>
async fn block(&self, height: u64) -> Result<(Hash, Block), RpcError>
Fetch a block hiven its height.
Source§async fn block_transactions(
&self,
_block: &Block,
) -> Result<Vec<Transaction>, RpcError>
async fn block_transactions( &self, _block: &Block, ) -> Result<Vec<Transaction>, RpcError>
Fetch a block’s transactions.
Source§async fn txpool_hashes(&self) -> Result<HashSet<Hash>, RpcError>
async fn txpool_hashes(&self) -> Result<HashSet<Hash>, RpcError>
Fetch the hashed of all transactions in the txpool.
Source§async fn transactions_by_hashes(
&self,
_hashes: &[Hash],
) -> Result<Vec<Transaction>, RpcError>
async fn transactions_by_hashes( &self, _hashes: &[Hash], ) -> Result<Vec<Transaction>, RpcError>
Fetch transactions given the hashes of those transactions.
Source§impl Clone for MockClient
impl Clone for MockClient
Source§fn clone(&self) -> MockClient
fn clone(&self) -> MockClient
Returns a copy 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 Debug for MockClient
impl Debug for MockClient
impl Copy for MockClient
Auto Trait Implementations§
impl Freeze for MockClient
impl RefUnwindSafe for MockClient
impl Send for MockClient
impl Sync for MockClient
impl Unpin for MockClient
impl UnwindSafe for MockClient
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more