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
28
29
30
31
32
33
34
use resources::Amount;

/// A create account operation represents a new account creation.
#[derive(Debug, Clone)]
pub struct CreateAccount {
    account: String,
    funder: String,
    starting_balance: Amount,
}

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

    /// The public address of the account that funded a new account.
    pub fn funder(&self) -> &str {
        &self.funder
    }

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