From 947cdd87489f6ee5139610eed2fbc6b1a1816e4d Mon Sep 17 00:00:00 2001 From: Greg Fitzgerald Date: Tue, 2 Apr 2019 08:36:10 -0600 Subject: [PATCH] Rename system_program to system_instrution_processor --- runtime/src/lib.rs | 2 +- runtime/src/runtime.rs | 7 +++++-- .../{system_program.rs => system_instruction_processor.rs} | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) rename runtime/src/{system_program.rs => system_instruction_processor.rs} (99%) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 0732a9db22..a1db8ab3ed 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -9,7 +9,7 @@ pub mod locked_accounts_results; mod native_loader; pub mod runtime; mod status_cache; -mod system_program; +mod system_instruction_processor; #[macro_use] extern crate solana_metrics; diff --git a/runtime/src/runtime.rs b/runtime/src/runtime.rs index 0ff1da097c..94f27f6fd1 100644 --- a/runtime/src/runtime.rs +++ b/runtime/src/runtime.rs @@ -1,4 +1,5 @@ use crate::native_loader; +use crate::system_instruction_processor; use solana_sdk::account::{create_keyed_accounts, Account, KeyedAccount}; use solana_sdk::instruction::InstructionError; use solana_sdk::message::Message; @@ -90,8 +91,10 @@ pub struct Runtime { impl Default for Runtime { fn default() -> Self { - let instruction_processors: Vec<(Pubkey, ProcessInstruction)> = - vec![(system_program::id(), crate::system_program::entrypoint)]; + let instruction_processors: Vec<(Pubkey, ProcessInstruction)> = vec![( + system_program::id(), + system_instruction_processor::process_instruction, + )]; Self { instruction_processors, diff --git a/runtime/src/system_program.rs b/runtime/src/system_instruction_processor.rs similarity index 99% rename from runtime/src/system_program.rs rename to runtime/src/system_instruction_processor.rs index e4ec6deedf..9d2742ffb2 100644 --- a/runtime/src/system_program.rs +++ b/runtime/src/system_instruction_processor.rs @@ -64,7 +64,7 @@ fn move_lamports(keyed_accounts: &mut [KeyedAccount], lamports: u64) -> Result<( Ok(()) } -pub fn entrypoint( +pub fn process_instruction( _program_id: &Pubkey, keyed_accounts: &mut [KeyedAccount], data: &[u8], @@ -243,7 +243,7 @@ mod tests { program_id: another_program_owner, }; let data = serialize(&instruction).unwrap(); - let result = entrypoint(&system_program::id(), &mut keyed_accounts, &data, 0); + let result = process_instruction(&system_program::id(), &mut keyed_accounts, &data, 0); assert_eq!(result, Err(InstructionError::IncorrectProgramId)); assert_eq!(from_account.owner, new_program_owner); }