Remove runtime dependency on storage (#4480)
This commit is contained in:
19
programs/storage_program/src/genesis_block_util.rs
Normal file
19
programs/storage_program/src/genesis_block_util.rs
Normal file
@ -0,0 +1,19 @@
|
||||
use crate::solana_storage_program;
|
||||
use solana_sdk::genesis_block::GenesisBlock;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use solana_storage_api::storage_contract;
|
||||
|
||||
pub trait GenesisBlockUtil {
|
||||
fn add_storage_program(&mut self, validator_storage_pubkey: &Pubkey);
|
||||
}
|
||||
|
||||
impl GenesisBlockUtil for GenesisBlock {
|
||||
fn add_storage_program(&mut self, validator_storage_pubkey: &Pubkey) {
|
||||
self.accounts.push((
|
||||
*validator_storage_pubkey,
|
||||
storage_contract::create_validator_storage_account(1),
|
||||
));
|
||||
self.native_instruction_processors
|
||||
.push(solana_storage_program!());
|
||||
}
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
pub mod genesis_block_util;
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! solana_storage_program {
|
||||
() => {
|
||||
|
Reference in New Issue
Block a user