Rename native programs to native instruction processors
This commit is contained in:
parent
947cdd8748
commit
fa1c1e3734
|
@ -369,7 +369,7 @@ pub fn new_fullnode_for_tests() -> (Fullnode, ContactInfo, Keypair, String) {
|
|||
let (mut genesis_block, mint_keypair) =
|
||||
GenesisBlock::new_with_leader(10_000, &contact_info.id, 42);
|
||||
genesis_block
|
||||
.native_programs
|
||||
.native_instruction_processors
|
||||
.push(("solana_budget_program".to_string(), solana_budget_api::id()));
|
||||
|
||||
let (ledger_path, _blockhash) = create_new_tmp_ledger!(&genesis_block);
|
||||
|
|
|
@ -336,7 +336,7 @@ mod tests {
|
|||
|
||||
// This test depends on the budget program
|
||||
genesis_block
|
||||
.native_programs
|
||||
.native_instruction_processors
|
||||
.push(("solana_budget_program".to_string(), solana_budget_api::id()));
|
||||
|
||||
let bob_pubkey = Pubkey::new_rand();
|
||||
|
|
|
@ -71,7 +71,9 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
|||
);
|
||||
genesis_block.mint_id = mint_keypair.pubkey();
|
||||
genesis_block.bootstrap_leader_vote_account_id = bootstrap_leader_vote_account_keypair.pubkey();
|
||||
genesis_block.native_programs.extend_from_slice(&[
|
||||
genesis_block
|
||||
.native_instruction_processors
|
||||
.extend_from_slice(&[
|
||||
("solana_budget_program".to_string(), solana_budget_api::id()),
|
||||
(
|
||||
"solana_storage_program".to_string(),
|
||||
|
|
|
@ -358,7 +358,7 @@ impl Bank {
|
|||
self.register_native_instruction_processor("solana_vote_program", &solana_vote_api::id());
|
||||
|
||||
// Add additional native programs specified in the genesis block
|
||||
for (name, program_id) in &genesis_block.native_programs {
|
||||
for (name, program_id) in &genesis_block.native_instruction_processors {
|
||||
self.register_native_instruction_processor(name, program_id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ pub struct GenesisBlock {
|
|||
pub slots_per_epoch: u64,
|
||||
pub stakers_slot_offset: u64,
|
||||
pub epoch_warmup: bool,
|
||||
pub native_programs: Vec<(String, Pubkey)>,
|
||||
pub native_instruction_processors: Vec<(String, Pubkey)>,
|
||||
}
|
||||
|
||||
impl GenesisBlock {
|
||||
|
@ -54,7 +54,7 @@ impl GenesisBlock {
|
|||
slots_per_epoch: DEFAULT_SLOTS_PER_EPOCH,
|
||||
stakers_slot_offset: DEFAULT_SLOTS_PER_EPOCH,
|
||||
epoch_warmup: true,
|
||||
native_programs: vec![],
|
||||
native_instruction_processors: vec![],
|
||||
},
|
||||
mint_keypair,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue