Struct diem_key_manager::diem_interface::JsonRpcDiemInterface [−][src]
pub struct JsonRpcDiemInterface { /* fields omitted */ }Expand description
This implements the DiemInterface by talking directly to the JSON RPC API.
DISCLAIMER: this implementation assumes that the json rpc client explicitly trusts the json rpc server that is responding to its requests (e.g., the client assumes the server has already been authenticated, provides encrypted and freshness protected messages, etc.). As such, the security of the server will need to be verified in production before this interface should be used. Pointing the client to an untrusted (and potentially malicious) json rpc server, can result in denial-of-service attacks (e.g., against the key manager).
TODO(joshlind): add proof checks to the JsonRpcClient to verify the state returned by the json rpc server we’re talking to. Although we won’t be able to guarantee freshness, it’s better than simply trusting the response for correctness..
Implementations
Trait Implementations
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. Read more
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. Read more
fn retrieve_validator_config(
&self,
account: AccountAddress
) -> Result<ValidatorConfig, Error>
fn retrieve_validator_config(
&self,
account: AccountAddress
) -> Result<ValidatorConfig, Error>
Retrieves the ValidatorConfig at the specified AccountAddress if one exists.
Retrieves the ValidatorInfo for the specified account from the current ValidatorSet if one exists. Read more
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. Read more
Auto Trait Implementations
impl RefUnwindSafe for JsonRpcDiemInterface
impl Send for JsonRpcDiemInterface
impl Sync for JsonRpcDiemInterface
impl Unpin for JsonRpcDiemInterface
impl UnwindSafe for JsonRpcDiemInterface
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = T
Should always be Self