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 nickfrosty committed Jan 4, 2023
1 parent d973b45 commit 1ab7c8c
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 @@ -19798,7 +19798,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 @@ -19828,8 +19828,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 1ab7c8c

Please sign in to comment.