diff --git a/program/tests/close.rs b/program/tests/close.rs index 7b68dcb..6d6cc7d 100644 --- a/program/tests/close.rs +++ b/program/tests/close.rs @@ -186,7 +186,7 @@ fn buffer_fail_authority_not_signer() { fn buffer_success() { let mollusk = setup(); - let buffer = Pubkey::new_unique(); + let buffer = Pubkey::new_from_array([1; 32]); // Consistent CUs when logging. let destination = Pubkey::new_unique(); let authority = Pubkey::new_unique(); @@ -213,6 +213,7 @@ fn buffer_success() { ], &[ Check::success(), + Check::compute_units(12_793), // Closed, but still owned by the loader. Check::account(&buffer) .data(&[0, 0, 0, 0]) // Size of Uninitialized. @@ -433,9 +434,7 @@ fn programdata_fail_incorrect_authority() { ), ), ], - &[ - Check::err(ProgramError::IncorrectAuthority), - ], + &[Check::err(ProgramError::IncorrectAuthority)], ); } @@ -491,7 +490,7 @@ fn programdata_success() { let destination = Pubkey::new_unique(); let authority = Pubkey::new_unique(); - let program = Pubkey::new_unique(); + let program = Pubkey::new_from_array([1; 32]); // Consistent CUs when logging. let programdata = get_program_data_address(&program); @@ -529,6 +528,7 @@ fn programdata_success() { ], &[ Check::success(), + Check::compute_units(14_432), // Closed, but still owned by the loader. Check::account(&programdata) .data(&[0, 0, 0, 0]) // Size of Uninitialized. diff --git a/program/tests/deploy.rs b/program/tests/deploy.rs index d7930a1..4ba24da 100644 --- a/program/tests/deploy.rs +++ b/program/tests/deploy.rs @@ -619,7 +619,7 @@ fn success() { let mollusk = setup(); let payer = Pubkey::new_unique(); - let program = Pubkey::new_unique(); + let program = Pubkey::new_from_array([1; 32]); // Consistent CUs when logging. let buffer = Pubkey::new_unique(); let authority = Pubkey::new_unique(); @@ -670,6 +670,7 @@ fn success() { ], &[ Check::success(), + Check::compute_units(21_855), Check::account(&program) .data( &bincode::serialize(&UpgradeableLoaderState::Program { diff --git a/program/tests/extend_program.rs b/program/tests/extend_program.rs index ec5e583..e3cbff0 100644 --- a/program/tests/extend_program.rs +++ b/program/tests/extend_program.rs @@ -559,7 +559,7 @@ fn success() { let mut mollusk = setup(); mollusk.warp_to_slot(2); // To move past deployment slot. - let program = Pubkey::new_unique(); + let program = Pubkey::new_from_array([1; 32]); // Consistent CUs when logging. let payer = Pubkey::new_unique(); let programdata = get_program_data_address(&program); @@ -613,6 +613,7 @@ fn success() { ], &[ Check::success(), + Check::compute_units(7_006), Check::account(&programdata) .lamports(new_rent_exemption) .space(new_size) diff --git a/program/tests/initialize_buffer.rs b/program/tests/initialize_buffer.rs index e283acc..5d8fc68 100644 --- a/program/tests/initialize_buffer.rs +++ b/program/tests/initialize_buffer.rs @@ -110,6 +110,7 @@ fn success() { ], &[ Check::success(), + Check::compute_units(2_149), Check::account(&source) .lamports(100_000_000) .owner(&solana_loader_v3_program::id()) diff --git a/program/tests/set_authority.rs b/program/tests/set_authority.rs index 8380167..273c140 100644 --- a/program/tests/set_authority.rs +++ b/program/tests/set_authority.rs @@ -171,7 +171,7 @@ fn buffer_success() { let buffer = Pubkey::new_unique(); let current_authority = Pubkey::new_unique(); - let new_authority = Pubkey::new_unique(); + let new_authority = Pubkey::new_from_array([1; 32]); // Consistent CUs when logging. let elf = &[3; 5_000]; @@ -204,6 +204,7 @@ fn buffer_success() { ], &[ Check::success(), + Check::compute_units(14_635), Check::account(&buffer) .data( &check_data(Some(new_authority)), // Updated. @@ -317,7 +318,7 @@ fn programdata_success() { let programdata = Pubkey::new_unique(); let current_authority = Pubkey::new_unique(); - let new_authority = Pubkey::new_unique(); + let new_authority = Pubkey::new_from_array([1; 32]); // Consistent CUs when logging. let elf = &[3; 5_000]; @@ -354,6 +355,7 @@ fn programdata_success() { ], &[ Check::success(), + Check::compute_units(14_639), Check::account(&programdata) .data( &check_data(Some(new_authority)), // Updated. @@ -382,6 +384,7 @@ fn programdata_success() { ], &[ Check::success(), + Check::compute_units(1_918), Check::account(&programdata) .data( &check_data(None), // Updated. diff --git a/program/tests/set_authority_checked.rs b/program/tests/set_authority_checked.rs index 80a40df..5806d70 100644 --- a/program/tests/set_authority_checked.rs +++ b/program/tests/set_authority_checked.rs @@ -172,7 +172,7 @@ fn buffer_success() { let buffer = Pubkey::new_unique(); let current_authority = Pubkey::new_unique(); - let new_authority = Pubkey::new_unique(); + let new_authority = Pubkey::new_from_array([1; 32]); // Consistent CUs when logging. let elf = &[3; 5_000]; @@ -205,6 +205,7 @@ fn buffer_success() { ], &[ Check::success(), + Check::compute_units(14_121), Check::account(&buffer) .data( &check_data(Some(new_authority)), // Updated. @@ -350,7 +351,7 @@ fn programdata_success() { let programdata = Pubkey::new_unique(); let current_authority = Pubkey::new_unique(); - let new_authority = Pubkey::new_unique(); + let new_authority = Pubkey::new_from_array([1; 32]); // Consistent CUs when logging. let elf = &[3; 5_000]; @@ -387,6 +388,7 @@ fn programdata_success() { ], &[ Check::success(), + Check::compute_units(14_102), Check::account(&programdata) .data( &check_data(Some(new_authority)), // Updated. diff --git a/program/tests/upgrade.rs b/program/tests/upgrade.rs index 3a6ba01..123641d 100644 --- a/program/tests/upgrade.rs +++ b/program/tests/upgrade.rs @@ -848,7 +848,7 @@ fn success() { let mut mollusk = setup(); mollusk.warp_to_slot(2); // To move past deployment slot. - let program = Pubkey::new_unique(); + let program = Pubkey::new_from_array([1; 32]); // Consistent CUs when logging. let buffer = Pubkey::new_unique(); let spill = Pubkey::new_unique(); let authority = Pubkey::new_unique(); @@ -899,6 +899,7 @@ fn success() { ], &[ Check::success(), + Check::compute_units(16_664), Check::account(&program) .data( &bincode::serialize(&UpgradeableLoaderState::Program { diff --git a/program/tests/write.rs b/program/tests/write.rs index c59588c..d225d19 100644 --- a/program/tests/write.rs +++ b/program/tests/write.rs @@ -209,6 +209,7 @@ fn success() { ], &[ Check::success(), + Check::compute_units(1_544), Check::account(&buffer).data(&check_data).build(), ], ); @@ -227,6 +228,7 @@ fn success() { ], &[ Check::success(), + Check::compute_units(1_698), Check::account(&buffer).data(&check_data).build(), ], );