Add native loader entry points (#9275)

This commit is contained in:
Jack May
2020-04-03 17:40:59 -07:00
committed by GitHub
parent c1441a2a8f
commit ed86d8d1fc
24 changed files with 297 additions and 154 deletions

View File

@ -20,6 +20,7 @@ use solana_sdk::{
epoch_schedule::EpochSchedule,
genesis_config::{GenesisConfig, OperatingMode},
message::Message,
native_loader,
poh_config::PohConfig,
pubkey::Pubkey,
signature::{Keypair, Signer},
@ -81,7 +82,7 @@ pub struct ClusterConfig {
pub slots_per_epoch: u64,
pub slots_per_segment: u64,
pub stakers_slot_offset: u64,
pub native_instruction_processors: Vec<(String, Pubkey)>,
pub native_instruction_processors: Vec<(native_loader::Info, Pubkey)>,
pub operating_mode: OperatingMode,
pub poh_config: PohConfig,
}
@ -179,14 +180,13 @@ impl LocalCluster {
.push(solana_storage_program!());
}
}
genesis_config.inflation =
solana_genesis_programs::get_inflation(genesis_config.operating_mode, 0).unwrap();
genesis_config
.native_instruction_processors
.extend_from_slice(&config.native_instruction_processors);
genesis_config.inflation =
solana_genesis_programs::get_inflation(genesis_config.operating_mode, 0).unwrap();
let storage_keypair = Keypair::new();
genesis_config.add_account(
storage_keypair.pubkey(),