Skip to content

Commit

Permalink
Fixes fork graph in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed Dec 15, 2023
1 parent dbc8030 commit fe4d591
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions programs/sbf/tests/programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2079,10 +2079,9 @@ fn test_program_sbf_invoke_in_same_tx_as_redeployment() {
);

// load_upgradeable_program sets clock sysvar to 1, which causes the program to be effective
// after 2 slots. So we need to advance the bank client by 2 slots here.
let bank = bank_client
.advance_slot(2, &Pubkey::default())
.expect("Failed to advance slot");
// after 2 slots. They need to be called individually to create the correct fork graph in between.
bank_client.advance_slot(1, &Pubkey::default()).unwrap();
let bank = bank_client.advance_slot(1, &Pubkey::default()).unwrap();

// Prepare redeployment
let buffer_keypair = Keypair::new();
Expand Down Expand Up @@ -2176,10 +2175,9 @@ fn test_program_sbf_invoke_in_same_tx_as_undeployment() {
);

// load_upgradeable_program sets clock sysvar to 1, which causes the program to be effective
// after 2 slots. So we need to advance the bank client by 2 slots here.
let bank = bank_client
.advance_slot(2, &Pubkey::default())
.expect("Failed to advance slot");
// after 2 slots. They need to be called individually to create the correct fork graph in between.
bank_client.advance_slot(1, &Pubkey::default()).unwrap();
let bank = bank_client.advance_slot(1, &Pubkey::default()).unwrap();

// Prepare undeployment
let (programdata_address, _) = Pubkey::find_program_address(
Expand Down

0 comments on commit fe4d591

Please sign in to comment.