pub trait Client {
    // Required methods
    fn get_last_version_before_timestamp(
        &self,
        timestamp_usecs: u64,
        version: Version
    ) -> Result<Version>;
    fn get_metadata(&self) -> Result<Response<MetadataView>>;
    fn get_metadata_by_version(
        &self,
        version: Version
    ) -> Result<Response<MetadataView>>;
    fn get_currencies(&self) -> Result<Response<Vec<CurrencyInfoView>>>;
    fn get_account_by_version(
        &self,
        address: AccountAddress,
        version: Version
    ) -> Result<Response<Option<AccountView>>>;
}
Expand description

A small trait abstracting over the Diem json-rpc client so we can mock during testing.

Required Methods§

source

fn get_last_version_before_timestamp( &self, timestamp_usecs: u64, version: Version ) -> Result<Version>

source

fn get_metadata(&self) -> Result<Response<MetadataView>>

source

fn get_metadata_by_version( &self, version: Version ) -> Result<Response<MetadataView>>

source

fn get_currencies(&self) -> Result<Response<Vec<CurrencyInfoView>>>

source

fn get_account_by_version( &self, address: AccountAddress, version: Version ) -> Result<Response<Option<AccountView>>>

Implementations on Foreign Types§

source§

impl Client for BlockingClient

source§

fn get_last_version_before_timestamp( &self, _timestamp_usecs: u64, _version: Version ) -> Result<Version>

source§

fn get_metadata(&self) -> Result<Response<MetadataView>>

source§

fn get_metadata_by_version( &self, version: Version ) -> Result<Response<MetadataView>>

source§

fn get_currencies(&self) -> Result<Response<Vec<CurrencyInfoView>>>

source§

fn get_account_by_version( &self, address: AccountAddress, version: Version ) -> Result<Response<Option<AccountView>>>

Implementors§