Rename system_program to system_instrution_processor
This commit is contained in:
parent
0a9f063d3e
commit
947cdd8748
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue