AccountSharedData construction (#15790)
This commit is contained in:
committed by
GitHub
parent
3419a5446e
commit
952c3bcbb7
@@ -13,7 +13,7 @@ use {
|
||||
hardened_unpack::MAX_GENESIS_ARCHIVE_UNPACKED_SIZE,
|
||||
},
|
||||
solana_sdk::{
|
||||
account::AccountSharedData,
|
||||
account::{Account, AccountSharedData},
|
||||
clock::{Slot, DEFAULT_MS_PER_SLOT},
|
||||
commitment_config::CommitmentConfig,
|
||||
fee_calculator::{FeeCalculator, FeeRateGovernor},
|
||||
@@ -133,7 +133,7 @@ impl TestValidatorGenesis {
|
||||
) -> &mut Self {
|
||||
self.add_account(
|
||||
address,
|
||||
AccountSharedData {
|
||||
AccountSharedData::from(Account {
|
||||
lamports,
|
||||
data: solana_program_test::read_file(
|
||||
solana_program_test::find_file(filename).unwrap_or_else(|| {
|
||||
@@ -143,7 +143,7 @@ impl TestValidatorGenesis {
|
||||
owner,
|
||||
executable: false,
|
||||
rent_epoch: 0,
|
||||
},
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -158,14 +158,14 @@ impl TestValidatorGenesis {
|
||||
) -> &mut Self {
|
||||
self.add_account(
|
||||
address,
|
||||
AccountSharedData {
|
||||
AccountSharedData::from(Account {
|
||||
lamports,
|
||||
data: base64::decode(data_base64)
|
||||
.unwrap_or_else(|err| panic!("Failed to base64 decode: {}", err)),
|
||||
owner,
|
||||
executable: false,
|
||||
rent_epoch: 0,
|
||||
},
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -285,13 +285,13 @@ impl TestValidator {
|
||||
let data = solana_program_test::read_file(&program.program_path);
|
||||
accounts.insert(
|
||||
program.program_id,
|
||||
AccountSharedData {
|
||||
AccountSharedData::from(Account {
|
||||
lamports: Rent::default().minimum_balance(data.len()).min(1),
|
||||
data,
|
||||
owner: program.loader,
|
||||
executable: true,
|
||||
rent_epoch: 0,
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user