diff --git a/src/main.rs b/src/main.rs index ea67130..28e0e06 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,6 +5,9 @@ use std::collections::HashMap; #[derive(Debug)] enum AccountingError { // Add variants here for account not found, account underfunded and account overfunded + AccountNotFound(String) , + AccountUnderFunded(String, u64), + AccountOverFunded(String, u64), } /// A transaction type. Transactions should be able to rebuild a ledger's state @@ -12,12 +15,15 @@ enum AccountingError { #[derive(Debug)] pub enum Tx { // Add variants for storing withdraw/deposit transactions + Withdraw{account:String, amount:u64}, + Deposit{account:String, amount:u64}, } /// A type for managing accounts and their current currency balance #[derive(Debug)] struct Accounts { // Add a property `accounts` here + accounts: HashMap, } impl Accounts {