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 (#28814)
  • Loading branch information
brooksprumo authored Nov 15, 2022
1 parent ff1ff58 commit ac9b117
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 ac9b117

Please sign in to comment.