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

@@ -22,10 +22,10 @@ impl RequestProcessor {
rsp_addr: SocketAddr,
) -> Option<(Response, SocketAddr)> {
match msg {
Request::GetBalance { key } => {
let val = self.bank.get_balance(&key);
let rsp = (Response::Balance { key, val }, rsp_addr);
info!("Response::Balance {:?}", rsp);
Request::GetAccount { key } => {
let account = self.bank.get_account(&key);
let rsp = (Response::Account { key, account }, rsp_addr);
info!("Response::Account {:?}", rsp);
Some(rsp)
}
Request::GetLastId => {