-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip adding builtins if they will be removed (#23233)
* Add failing test for precompile transition * Skip adding builtins if they will be removed * cargo clean * nits * fix abi check * remove workaround Co-authored-by: Jack May <[email protected]>
- Loading branch information
Showing
4 changed files
with
147 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
use { | ||
crate::bank::*, | ||
solana_sdk::{feature_set::FeatureSet, genesis_config::create_genesis_config}, | ||
}; | ||
|
||
#[test] | ||
fn test_startup_from_snapshot_after_precompile_transition() { | ||
let (genesis_config, _mint_keypair) = create_genesis_config(100_000); | ||
|
||
let mut bank = Bank::new_for_tests(&genesis_config); | ||
bank.feature_set = Arc::new(FeatureSet::all_enabled()); | ||
bank.finish_init(&genesis_config, None, false); | ||
|
||
// Overwrite precompile accounts to simulate a cluster which already added precompiles. | ||
for precompile in get_precompiles() { | ||
bank.store_account(&precompile.program_id, &AccountSharedData::default()); | ||
bank.add_precompiled_account(&precompile.program_id); | ||
} | ||
|
||
bank.freeze(); | ||
|
||
// Simulate starting up from snapshot finishing the initialization for a frozen bank | ||
bank.finish_init(&genesis_config, None, false); | ||
} | ||
} |
Oops, something went wrong.