1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use resources::Amount;
/// This effect is the result of a create account operation and represents
/// the fact that an account was created
#[derive(Debug, Deserialize, Clone)]
pub struct Created {
    account: String,
    starting_balance: Amount,
}

impl Created {
    /// Creates a new Account
    pub fn new(account: String, starting_balance: Amount) -> Created {
        Created {
            account,
            starting_balance,
        }
    }
    /// The public address of a new account that was funded.
    pub fn account(&self) -> &String {
        &self.account
    }

    /// Amount the account was funded.
    pub fn starting_balance(&self) -> Amount {
        self.starting_balance
    }
}