Account->AccountSharedData (#15691)
This commit is contained in:
committed by
GitHub
parent
61c7ce857e
commit
8a3135d17b
@ -19,6 +19,7 @@ use solana_runtime::genesis_utils::{
|
||||
};
|
||||
use solana_sdk::{
|
||||
account::Account,
|
||||
account::AccountSharedData,
|
||||
client::SyncClient,
|
||||
clock::{DEFAULT_DEV_SLOTS_PER_EPOCH, DEFAULT_TICKS_PER_SLOT},
|
||||
commitment_config::CommitmentConfig,
|
||||
@ -69,7 +70,7 @@ pub struct ClusterConfig {
|
||||
pub native_instruction_processors: Vec<(String, Pubkey)>,
|
||||
pub cluster_type: ClusterType,
|
||||
pub poh_config: PohConfig,
|
||||
pub additional_accounts: Vec<(Pubkey, Account)>,
|
||||
pub additional_accounts: Vec<(Pubkey, AccountSharedData)>,
|
||||
}
|
||||
|
||||
impl Default for ClusterConfig {
|
||||
@ -169,9 +170,12 @@ impl LocalCluster {
|
||||
stakes_in_genesis,
|
||||
config.cluster_type,
|
||||
);
|
||||
genesis_config
|
||||
.accounts
|
||||
.extend(config.additional_accounts.drain(..));
|
||||
genesis_config.accounts.extend(
|
||||
config
|
||||
.additional_accounts
|
||||
.drain(..)
|
||||
.map(|(key, account)| (key, Account::from(account))),
|
||||
);
|
||||
genesis_config.ticks_per_slot = config.ticks_per_slot;
|
||||
genesis_config.epoch_schedule = EpochSchedule::custom(
|
||||
config.slots_per_epoch,
|
||||
|
@ -38,7 +38,7 @@ use solana_runtime::{
|
||||
snapshot_utils,
|
||||
};
|
||||
use solana_sdk::{
|
||||
account::Account,
|
||||
account::AccountSharedData,
|
||||
client::{AsyncClient, SyncClient},
|
||||
clock::{self, Slot},
|
||||
commitment_config::CommitmentConfig,
|
||||
@ -286,7 +286,7 @@ fn run_cluster_partition<E, F>(
|
||||
leader_schedule: Option<(LeaderSchedule, Vec<Arc<Keypair>>)>,
|
||||
on_partition_start: E,
|
||||
on_partition_resolved: F,
|
||||
additional_accounts: Vec<(Pubkey, Account)>,
|
||||
additional_accounts: Vec<(Pubkey, AccountSharedData)>,
|
||||
) where
|
||||
E: FnOnce(&mut LocalCluster),
|
||||
F: FnOnce(&mut LocalCluster),
|
||||
@ -2240,7 +2240,11 @@ fn setup_transfer_scan_threads(
|
||||
scan_commitment: CommitmentConfig,
|
||||
update_client_receiver: Receiver<ThinClient>,
|
||||
scan_client_receiver: Receiver<ThinClient>,
|
||||
) -> (JoinHandle<()>, JoinHandle<()>, Vec<(Pubkey, Account)>) {
|
||||
) -> (
|
||||
JoinHandle<()>,
|
||||
JoinHandle<()>,
|
||||
Vec<(Pubkey, AccountSharedData)>,
|
||||
) {
|
||||
let exit_ = exit.clone();
|
||||
let starting_keypairs: Arc<Vec<Keypair>> = Arc::new(
|
||||
iter::repeat_with(Keypair::new)
|
||||
@ -2252,9 +2256,14 @@ fn setup_transfer_scan_threads(
|
||||
.take(num_starting_accounts)
|
||||
.collect(),
|
||||
);
|
||||
let starting_accounts: Vec<(Pubkey, Account)> = starting_keypairs
|
||||
let starting_accounts: Vec<(Pubkey, AccountSharedData)> = starting_keypairs
|
||||
.iter()
|
||||
.map(|k| (k.pubkey(), Account::new(1, 0, &system_program::id())))
|
||||
.map(|k| {
|
||||
(
|
||||
k.pubkey(),
|
||||
AccountSharedData::new(1, 0, &system_program::id()),
|
||||
)
|
||||
})
|
||||
.collect();
|
||||
|
||||
let starting_keypairs_ = starting_keypairs.clone();
|
||||
|
Reference in New Issue
Block a user