Skip to content

Commit

Permalink
Lowers test's account data size to avoid hitting MaxLoadedAccountsDat…
Browse files Browse the repository at this point in the history
…aSizeExceed (solana-labs#28814)
  • Loading branch information
brooksprumo authored and xiangzhu70 committed Nov 16, 2022
1 parent 3ff277c commit 7245ad9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19833,7 +19833,7 @@ pub(crate) mod tests {
let account_balance = LAMPORTS_PER_SOL;
let account_size = rng.gen_range(
1,
MAX_PERMITTED_DATA_LENGTH as usize - MAX_PERMITTED_DATA_INCREASE,
(MAX_PERMITTED_DATA_LENGTH / 4) as usize - MAX_PERMITTED_DATA_INCREASE,
);
let account_data =
AccountSharedData::new(account_balance, account_size, &mock_program_id);
Expand Down Expand Up @@ -19863,8 +19863,9 @@ pub(crate) mod tests {
{
let account_pubkey = Pubkey::new_unique();
let account_balance = LAMPORTS_PER_SOL;
let account_size =
rng.gen_range(MAX_PERMITTED_DATA_LENGTH / 2, MAX_PERMITTED_DATA_LENGTH) as usize;
let account_size = rng
.gen_range(MAX_PERMITTED_DATA_LENGTH / 8, MAX_PERMITTED_DATA_LENGTH / 4)
as usize;
let account_data =
AccountSharedData::new(account_balance, account_size, &mock_program_id);
bank.store_account(&account_pubkey, &account_data);
Expand Down

0 comments on commit 7245ad9

Please sign in to comment.