Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes unnecessary feature activation when testing accounts data size #34701

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions runtime/src/bank/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10223,9 +10223,8 @@ fn test_transaction_log_collector_get_logs_for_address() {
#[test]
fn test_accounts_data_size_with_good_transaction() {
const ACCOUNT_SIZE: u64 = MAX_PERMITTED_DATA_LENGTH;
let (genesis_config, mint_keypair) = create_genesis_config(sol_to_lamports(1_000.));
let mut bank = Bank::new_for_tests(&genesis_config);
bank.activate_feature(&feature_set::cap_accounts_data_len::id());
let (genesis_config, mint_keypair) = create_genesis_config(1_000 * LAMPORTS_PER_SOL);
let bank = Bank::new_for_tests(&genesis_config);
let bank = bank.wrap_with_bank_forks_for_tests().0;
let transaction = system_transaction::create_account(
&mint_keypair,
Expand Down Expand Up @@ -10265,8 +10264,9 @@ fn test_accounts_data_size_with_good_transaction() {
#[test]
fn test_accounts_data_size_with_bad_transaction() {
const ACCOUNT_SIZE: u64 = MAX_PERMITTED_DATA_LENGTH;
let mut bank = create_simple_test_bank(1_000_000_000_000);
bank.activate_feature(&feature_set::cap_accounts_data_len::id());
let (genesis_config, _mint_keypair) = create_genesis_config(1_000 * LAMPORTS_PER_SOL);
let bank = Bank::new_for_tests(&genesis_config);
let bank = bank.wrap_with_bank_forks_for_tests().0;
Comment on lines +10267 to +10269
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also took this opportunity to make the bank creation part here identical to what's in test_accounts_data_size_with_good_transaction.

let transaction = system_transaction::create_account(
&Keypair::new(),
&Keypair::new(),
Expand All @@ -10276,8 +10276,6 @@ fn test_accounts_data_size_with_bad_transaction() {
&solana_sdk::system_program::id(),
);

let bank = bank.wrap_with_bank_forks_for_tests().0;

let accounts_data_size_before = bank.load_accounts_data_size();
let accounts_data_size_delta_before = bank.load_accounts_data_size_delta();
let accounts_data_size_delta_on_chain_before = bank.load_accounts_data_size_delta_on_chain();
Expand Down