Skip to content

Commit

Permalink
processor: set authority checked: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec committed Oct 1, 2024
1 parent 64433b1 commit 004da11
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
8 changes: 4 additions & 4 deletions program/tests/initialize_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn fail_buffer_already_initialized() {
],
&[
Check::err(ProgramError::AccountAlreadyInitialized),
Check::compute_units(1245),
Check::compute_units(1244),
],
);
}
Expand All @@ -62,7 +62,7 @@ fn fail_buffer_account_too_small() {
],
&[
Check::err(ProgramError::InvalidAccountData),
Check::compute_units(789),
Check::compute_units(788),
],
);
}
Expand All @@ -89,7 +89,7 @@ fn fail_buffer_account_not_owned_by_loader() {
],
&[
Check::instruction_err(InstructionError::ExternalAccountDataModified),
Check::compute_units(642),
Check::compute_units(641),
],
);
}
Expand All @@ -116,7 +116,7 @@ fn success() {
],
&[
Check::success(),
Check::compute_units(2169),
Check::compute_units(2168),
Check::account(&source)
.lamports(100_000_000)
.owner(&solana_loader_v3_program::id())
Expand Down
33 changes: 33 additions & 0 deletions program/tests/set_authority_checked.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#![cfg(feature = "test-sbf")]

mod common;

#[test]
fn fail_invalid_account_state() {}

#[test]
fn buffer_fail_buffer_immutable() {}

#[test]
fn buffer_fail_incorrect_authority() {}

#[test]
fn buffer_fail_authority_not_signer() {}

#[test]
fn buffer_fail_new_authority_not_signer() {}

#[test]
fn programdata_fail_not_upgradeable() {}

#[test]
fn programdata_fail_incorrect_authority() {}

#[test]
fn programdata_fail_authority_not_signer() {}

#[test]
fn programdata_fail_new_authority_not_signer() {}

#[test]
fn success() {}
4 changes: 2 additions & 2 deletions program/tests/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn success() {
],
&[
Check::success(),
Check::compute_units(1418),
Check::compute_units(1419),
Check::account(&buffer).data(&check_data).build(),
],
);
Expand All @@ -79,7 +79,7 @@ fn success() {
],
&[
Check::success(),
Check::compute_units(1390),
Check::compute_units(1391),
Check::account(&buffer).data(&check_data).build(),
],
);
Expand Down

0 comments on commit 004da11

Please sign in to comment.