Accounts with state (#954)

* Account type with state

* fixed test according to @rob-solana
This commit is contained in:
anatoly yakovenko
2018-08-15 14:32:11 -07:00
committed by GitHub
parent db35f220f7
commit c23fa289c3
11 changed files with 324 additions and 193 deletions

View File

@@ -1,12 +1,13 @@
//! The `request` module defines the messages for the thin client.
use bank::Account;
use hash::Hash;
use signature::{Pubkey, Signature};
#[cfg_attr(feature = "cargo-clippy", allow(large_enum_variant))]
#[derive(Serialize, Deserialize, Debug, Clone, Copy)]
pub enum Request {
GetBalance { key: Pubkey },
GetAccount { key: Pubkey },
GetLastId,
GetTransactionCount,
GetSignature { signature: Signature },
@@ -22,9 +23,20 @@ impl Request {
#[derive(Serialize, Deserialize, Debug)]
pub enum Response {
Balance { key: Pubkey, val: i64 },
LastId { id: Hash },
TransactionCount { transaction_count: u64 },
SignatureStatus { signature_status: bool },
Finality { time: usize },
Account {
key: Pubkey,
account: Option<Account>,
},
LastId {
id: Hash,
},
TransactionCount {
transaction_count: u64,
},
SignatureStatus {
signature_status: bool,
},
Finality {
time: usize,
},
}