Trait diem_key_manager::diem_interface::DiemInterface[][src]

pub trait DiemInterface {
    fn diem_timestamp(&self) -> Result<u64, Error>;
fn last_reconfiguration(&self) -> Result<u64, Error>;
fn retrieve_sequence_number(
        &self,
        account: AccountAddress
    ) -> Result<u64, Error>;
fn submit_transaction(&self, transaction: Transaction) -> Result<(), Error>;
fn retrieve_validator_config(
        &self,
        account: AccountAddress
    ) -> Result<ValidatorConfig, Error>;
fn retrieve_validator_info(
        &self,
        account: AccountAddress
    ) -> Result<ValidatorInfo, Error>;
fn retrieve_account_state(
        &self,
        account: AccountAddress
    ) -> Result<AccountState, Error>; }
Expand description

This defines a generic trait used to interact with the Diem blockchain. In production, this will be talking to a JSON-RPC service. For tests, this may be an executor and storage directly.

Required methods

Retrieves the current time from the blockchain, this is returned as microseconds.

Retrieves the last reconfiguration time from the blockchain, this is returned as microseconds.

Retrieve current sequence number for the provided account.

Submits a transaction to the block chain and returns successfully if the transaction was successfully submitted. It does not necessarily mean the transaction successfully executed.

Retrieves the ValidatorConfig at the specified AccountAddress if one exists.

Retrieves the ValidatorInfo for the specified account from the current ValidatorSet if one exists.

Fetches the AccountState associated with a specific account. This is currently only used by test code, but it’s not completely inconceivable that non-test code will want access to this in the future.

Implementors