diff --git a/src/bank.rs b/src/bank.rs index 09b7ac8191..ff0e6d56ab 100644 --- a/src/bank.rs +++ b/src/bank.rs @@ -819,7 +819,7 @@ impl Bank { // It's up to the contract to implement its own rules on moving funds if system_program::check_id(&program_id) { if let Err(err) = - system_program::process_transaction(&tx, instruction_index, program_accounts) + system_program::process_instruction(&tx, instruction_index, program_accounts) { let err = match err { system_program::Error::ResultWithNegativeTokens(i) => { @@ -830,19 +830,19 @@ impl Bank { return Err(err); } } else if budget_program::check_id(&program_id) { - if budget_program::process_transaction(&tx, instruction_index, program_accounts) + if budget_program::process_instruction(&tx, instruction_index, program_accounts) .is_err() { return Err(BankError::ProgramRuntimeError(instruction_index as u8)); } } else if storage_program::check_id(&program_id) { - if storage_program::process_transaction(&tx, instruction_index, program_accounts) + if storage_program::process_instruction(&tx, instruction_index, program_accounts) .is_err() { return Err(BankError::ProgramRuntimeError(instruction_index as u8)); } } else if vote_program::check_id(&program_id) { - if vote_program::process_transaction(&tx, instruction_index, program_accounts).is_err() + if vote_program::process_instruction(&tx, instruction_index, program_accounts).is_err() { return Err(BankError::ProgramRuntimeError(instruction_index as u8)); } diff --git a/src/budget_program.rs b/src/budget_program.rs index e7c729efa0..3e1c94a943 100644 --- a/src/budget_program.rs +++ b/src/budget_program.rs @@ -116,13 +116,13 @@ fn apply_debits( /// * 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( +pub fn process_instruction( tx: &Transaction, instruction_index: usize, accounts: &mut [&mut Account], ) -> Result<(), BudgetError> { if let Ok(instruction) = deserialize(tx.userdata(instruction_index)) { - trace!("process_transaction: {:?}", instruction); + trace!("process_instruction: {:?}", instruction); apply_debits(tx, instruction_index, accounts, &instruction) } else { info!( @@ -264,7 +264,7 @@ mod test { fn process_transaction(tx: &Transaction, accounts: &mut [Account]) -> Result<(), BudgetError> { let mut refs: Vec<&mut Account> = accounts.iter_mut().collect(); - super::process_transaction(&tx, 0, &mut refs[..]) + super::process_instruction(&tx, 0, &mut refs[..]) } #[test] fn test_serializer() { diff --git a/src/storage_program.rs b/src/storage_program.rs index dd46deaa40..991bd04747 100644 --- a/src/storage_program.rs +++ b/src/storage_program.rs @@ -34,7 +34,7 @@ pub fn get_balance(account: &Account) -> u64 { account.tokens } -pub fn process_transaction( +pub fn process_instruction( tx: &Transaction, pix: usize, _accounts: &mut [&mut Account], @@ -61,6 +61,6 @@ mod test { fn test_storage_tx() { let keypair = Keypair::new(); let tx = Transaction::new(&keypair, &[], id(), &(), Default::default(), 0); - assert!(process_transaction(&tx, 0, &mut []).is_err()); + assert!(process_instruction(&tx, 0, &mut []).is_err()); } } diff --git a/src/system_program.rs b/src/system_program.rs index cbfb1c1b93..9c5b8fd606 100644 --- a/src/system_program.rs +++ b/src/system_program.rs @@ -35,13 +35,13 @@ pub fn id() -> Pubkey { pub fn get_balance(account: &Account) -> u64 { account.tokens } -pub fn process_transaction( +pub fn process_instruction( tx: &Transaction, pix: usize, accounts: &mut [&mut Account], ) -> Result<()> { if let Ok(syscall) = deserialize(tx.userdata(pix)) { - trace!("process_transaction: {:?}", syscall); + trace!("process_instruction: {:?}", syscall); match syscall { SystemInstruction::CreateAccount { tokens, @@ -111,7 +111,7 @@ mod test { fn process_transaction(tx: &Transaction, accounts: &mut [Account]) -> Result<()> { let mut refs: Vec<&mut Account> = accounts.iter_mut().collect(); - super::process_transaction(&tx, 0, &mut refs[..]) + super::process_instruction(&tx, 0, &mut refs[..]) } #[test] diff --git a/src/vote_program.rs b/src/vote_program.rs index 7e9289a41e..d5a2b25214 100644 --- a/src/vote_program.rs +++ b/src/vote_program.rs @@ -64,7 +64,7 @@ pub fn id() -> Pubkey { Pubkey::new(&VOTE_PROGRAM_ID) } -pub fn process_transaction( +pub fn process_instruction( tx: &Transaction, instruction_index: usize, accounts: &mut [&mut Account],