pub fn process_transaction(
        tx: &Transaction,
        instruction_index: usize,
        accounts: &mut [&mut Account],
    ) -> Result<(), BudgetError> {
        if let Ok(instruction) = deserialize(tx.userdata(instruction_index)) {
            trace!("process_transaction: {:?}", instruction);
            Self::apply_debits_to_budget_state(tx, instruction_index, accounts, &instruction)
        } else {
            info!(
                "Invalid transaction userdata: {:?}",
                tx.userdata(instruction_index)
            );
            Err(BudgetError::UserdataDeserializeFailure)
        }
    }
/// Budget DSL contract interface
/// * tx - the transaction
/// * accounts[0] - The source of the tokens
/// * accounts[1] - The contract context.  Once the contract has been completed, the tokens can
/// be spent from this account .
Budget DSL contract interface
tx - the transaction
accounts[0] - The source of the tokens
accounts[1] - The contract context.  Once the contract has been completed, the tokens can
be spent from this account .
Budget DSL contract interface tx - the transaction accounts [ 0 ] - The source of the tokens accounts [ 1 ] - The contract context . Once the contract has been completed the tokens can be spent from this account .
pub fn process_transaction(
        tx: &Transaction,
        instruction_index: usize,
        accounts: &mut [&mut Account],
    ) -> Result<(), BudgetError> {
        if let Ok(instruction) = deserialize(tx.userdata(instruction_index)) {
            trace!("process_transaction: {:?}", instruction);
            Self::apply_debits_to_budget_state(tx, instruction_index, accounts, &instruction)
        } else {
            info!(
                "Invalid transaction userdata: {:?}",
                tx.userdata(instruction_index)
            );
            Err(BudgetError::UserdataDeserializeFailure)
        }
    }
pub fn process_transaction ( tx : & Transaction , instruction_index : usize , accounts : & mut [ & mut Account ] , ) -> Result < ( ) , BudgetError > { if let Ok ( instruction ) = deserialize ( tx . userdata ( instruction_index ) ) { trace ! ( " " instruction ) ; Self :: apply_debits_to_budget_state ( tx , instruction_index , accounts , & instruction ) } else { info ! ( " " tx userdata ( instruction_index ) ) ; Err ( BudgetError :: UserdataDeserializeFailure ) } }
Budget DSL contract interface
 tx - the transaction
 accounts[0] - The source of the tokens
 accounts[1] - The contract context.
Budget DSL contract interface tx - the transaction accounts [ 0 ] - The source of the tokens accounts [ 1 ] - The contract context .
tx
&Transaction
instruction_index
usize
accounts
&mut [&mut Account]
tx
&Transaction
instruction_index
usize
accounts
&mut [&mut Account]