Use zero to represent a nonexistent account

This also fixes a bug in the thin client where a nonexistent account
would have triggered a panic because we were using `balances[k]` instead
of `balances.get(key)`.

Fixes #534
This commit is contained in:
Greg Fitzgerald
2018-07-02 17:31:10 -06:00
committed by Greg Fitzgerald
parent d2bb4dc14a
commit 0dabdfd48e
4 changed files with 31 additions and 28 deletions

View File

@@ -21,7 +21,7 @@ impl Request {
#[derive(Serialize, Deserialize, Debug)]
pub enum Response {
Balance { key: PublicKey, val: Option<i64> },
Balance { key: PublicKey, val: i64 },
LastId { id: Hash },
TransactionCount { transaction_count: u64 },
SignatureStatus { signature_status: bool },