AccountSharedData construction (#15790)

This commit is contained in:
Jeff Washington (jwash)
2021-03-11 18:09:04 -06:00
committed by GitHub
parent 3419a5446e
commit 952c3bcbb7
21 changed files with 161 additions and 151 deletions

View File

@@ -1,4 +1,8 @@
use solana_sdk::{account::AccountSharedData, pubkey::Pubkey, rent::Rent};
use solana_sdk::{
account::{Account, AccountSharedData},
pubkey::Pubkey,
rent::Rent,
};
mod spl_token {
solana_sdk::declare_id!("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
@@ -35,13 +39,13 @@ pub fn spl_programs(rent: &Rent) -> Vec<(Pubkey, AccountSharedData)> {
.map(|(program_id, elf)| {
(
*program_id,
AccountSharedData {
AccountSharedData::from(Account {
lamports: rent.minimum_balance(elf.len()).min(1),
data: elf.to_vec(),
owner: solana_program::bpf_loader::id(),
executable: true,
rent_epoch: 0,
},
}),
)
})
.collect()