Various spelling fixes
This commit is contained in:
@ -343,7 +343,7 @@ impl Bank {
|
|||||||
/// Execute a transaction.
|
/// Execute a transaction.
|
||||||
/// This method calls the contract's process_transaction method and verifies that the result of
|
/// This method calls the contract's process_transaction method and verifies that the result of
|
||||||
/// the contract does not violate the bank's accounting rules.
|
/// the contract does not violate the bank's accounting rules.
|
||||||
/// The accounts are commited back to the bank only if this function returns Ok(_).
|
/// The accounts are committed back to the bank only if this function returns Ok(_).
|
||||||
fn execute_transaction(tx: Transaction, accounts: &mut [Account]) -> Result<Transaction> {
|
fn execute_transaction(tx: Transaction, accounts: &mut [Account]) -> Result<Transaction> {
|
||||||
let pre_total: i64 = accounts.iter().map(|a| a.tokens).sum();
|
let pre_total: i64 = accounts.iter().map(|a| a.tokens).sum();
|
||||||
let pre_data: Vec<_> = accounts
|
let pre_data: Vec<_> = accounts
|
||||||
|
@ -127,7 +127,7 @@ impl BudgetContract {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if accounts[0].tokens < contract.tokens {
|
if accounts[0].tokens < contract.tokens {
|
||||||
trace!("insufficent funds");
|
trace!("insufficient funds");
|
||||||
return Err(BudgetError::InsufficientFunds(tx.keys[0]));
|
return Err(BudgetError::InsufficientFunds(tx.keys[0]));
|
||||||
} else {
|
} else {
|
||||||
accounts[0].tokens -= contract.tokens;
|
accounts[0].tokens -= contract.tokens;
|
||||||
@ -175,7 +175,7 @@ impl BudgetContract {
|
|||||||
Err(BudgetError::UninitializedContract(tx.keys[1]))
|
Err(BudgetError::UninitializedContract(tx.keys[1]))
|
||||||
} else {
|
} else {
|
||||||
state.apply_timestamp(tx, accounts, *dt)?;
|
state.apply_timestamp(tx, accounts, *dt)?;
|
||||||
trace!("apply timestamp commited");
|
trace!("apply timestamp committed");
|
||||||
state.serialize(&mut accounts[1].userdata);
|
state.serialize(&mut accounts[1].userdata);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -191,7 +191,7 @@ impl BudgetContract {
|
|||||||
} else {
|
} else {
|
||||||
trace!("apply signature");
|
trace!("apply signature");
|
||||||
state.apply_signature(tx, *signature, accounts)?;
|
state.apply_signature(tx, *signature, accounts)?;
|
||||||
trace!("apply signature commited");
|
trace!("apply signature committed");
|
||||||
state.serialize(&mut accounts[1].userdata);
|
state.serialize(&mut accounts[1].userdata);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ pub struct Vote {
|
|||||||
/// An instruction to progress the smart contract.
|
/// An instruction to progress the smart contract.
|
||||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
|
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
|
||||||
pub enum Instruction {
|
pub enum Instruction {
|
||||||
/// Declare and instanstansiate `Contract`.
|
/// Declare and instantiate `Contract`.
|
||||||
NewContract(Contract),
|
NewContract(Contract),
|
||||||
|
|
||||||
/// Tell a payment plan acknowledge the given `DateTime` has past.
|
/// Tell a payment plan acknowledge the given `DateTime` has past.
|
||||||
|
Reference in New Issue
Block a user