Account->AccountSharedData (#15691)
This commit is contained in:
committed by
GitHub
parent
61c7ce857e
commit
8a3135d17b
@ -1209,7 +1209,7 @@ pub mod tests {
|
||||
self, create_genesis_config_with_vote_accounts, ValidatorVoteKeypairs,
|
||||
};
|
||||
use solana_sdk::{
|
||||
account::Account,
|
||||
account::AccountSharedData,
|
||||
epoch_schedule::EpochSchedule,
|
||||
hash::Hash,
|
||||
pubkey::Pubkey,
|
||||
@ -2458,7 +2458,7 @@ pub mod tests {
|
||||
let mut hash = bank.last_blockhash();
|
||||
|
||||
let present_account_key = Keypair::new();
|
||||
let present_account = Account::new(1, 10, &Pubkey::default());
|
||||
let present_account = AccountSharedData::new(1, 10, &Pubkey::default());
|
||||
bank.store_account(&present_account_key.pubkey(), &present_account);
|
||||
|
||||
let entries: Vec<_> = (0..NUM_TRANSFERS)
|
||||
@ -2840,7 +2840,7 @@ pub mod tests {
|
||||
}
|
||||
|
||||
let present_account_key = Keypair::new();
|
||||
let present_account = Account::new(1, 10, &Pubkey::default());
|
||||
let present_account = AccountSharedData::new(1, 10, &Pubkey::default());
|
||||
bank.store_account(&present_account_key.pubkey(), &present_account);
|
||||
|
||||
let mut i = 0;
|
||||
@ -3013,7 +3013,7 @@ pub mod tests {
|
||||
let bank = Arc::new(Bank::new(&genesis_config));
|
||||
|
||||
let present_account_key = Keypair::new();
|
||||
let present_account = Account::new(1, 10, &Pubkey::default());
|
||||
let present_account = AccountSharedData::new(1, 10, &Pubkey::default());
|
||||
bank.store_account(&present_account_key.pubkey(), &present_account);
|
||||
|
||||
let keypair = Keypair::new();
|
||||
@ -3347,8 +3347,11 @@ pub mod tests {
|
||||
.map(|(root, stake)| {
|
||||
let mut vote_state = VoteState::default();
|
||||
vote_state.root_slot = Some(root);
|
||||
let mut vote_account =
|
||||
Account::new(1, VoteState::size_of(), &solana_vote_program::id());
|
||||
let mut vote_account = AccountSharedData::new(
|
||||
1,
|
||||
VoteState::size_of(),
|
||||
&solana_vote_program::id(),
|
||||
);
|
||||
let versioned = VoteStateVersions::new_current(vote_state);
|
||||
VoteState::serialize(&versioned, &mut vote_account.data).unwrap();
|
||||
(
|
||||
|
@ -68,7 +68,7 @@ pub(crate) mod tests {
|
||||
use rand::Rng;
|
||||
use solana_runtime::vote_account::{ArcVoteAccount, VoteAccounts};
|
||||
use solana_sdk::{
|
||||
account::{from_account, Account},
|
||||
account::{from_account, AccountSharedData},
|
||||
clock::Clock,
|
||||
instruction::Instruction,
|
||||
pubkey::Pubkey,
|
||||
@ -212,7 +212,8 @@ pub(crate) mod tests {
|
||||
let mut result: Vec<_> = epoch_stakes_and_lockouts(&bank, next_leader_schedule_epoch);
|
||||
result.sort();
|
||||
let stake_history =
|
||||
from_account::<StakeHistory>(&bank.get_account(&stake_history::id()).unwrap()).unwrap();
|
||||
from_account::<StakeHistory, _>(&bank.get_account(&stake_history::id()).unwrap())
|
||||
.unwrap();
|
||||
let mut expected = vec![
|
||||
(
|
||||
leader_stake.stake(bank.epoch(), Some(&stake_history), true),
|
||||
@ -309,7 +310,7 @@ pub(crate) mod tests {
|
||||
));
|
||||
let mut rng = rand::thread_rng();
|
||||
let vote_accounts = stakes.into_iter().map(|(stake, vote_state)| {
|
||||
let account = Account::new_data(
|
||||
let account = AccountSharedData::new_data(
|
||||
rng.gen(), // lamports
|
||||
&VoteStateVersions::new_current(vote_state),
|
||||
&Pubkey::new_unique(), // owner
|
||||
|
Reference in New Issue
Block a user