Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarry committed Mar 22, 2024
1 parent 498fb0e commit 01faab4
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions cli/tests/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#![allow(clippy::items_after_test_module)]

use {
assert_matches::assert_matches,
serde_json::Value,
solana_cli::{
cli::{process_command, CliCommand, CliConfig},
Expand Down Expand Up @@ -2191,25 +2192,24 @@ fn cli_program_deploy_with_args(compute_unit_price: Option<u64>) {
);
}

match try_from_slice_unchecked(&tx.message.instructions[0].data) {
Ok(ComputeBudgetInstruction::SetComputeUnitPrice(price))
if price == compute_unit_price => {}
ix => assert!(false, "unexpected ix {ix:?}"),
}
assert_matches!(
try_from_slice_unchecked(&tx.message.instructions[0].data),
Ok(ComputeBudgetInstruction::SetComputeUnitPrice(price)) if price == compute_unit_price
);
}

match try_from_slice_unchecked(&initial_tx.message.instructions[1].data) {
Ok(ComputeBudgetInstruction::SetComputeUnitLimit(2820)) => {}
ix => assert!(false, "unexpected ix {ix:?}"),
}
match try_from_slice_unchecked(&write_tx.message.instructions[1].data) {
Ok(ComputeBudgetInstruction::SetComputeUnitLimit(2670)) => {}
ix => assert!(false, "unexpected ix {ix:?}"),
}
match try_from_slice_unchecked(&final_tx.message.instructions[1].data) {
Ok(ComputeBudgetInstruction::SetComputeUnitLimit(2970)) => {}
ix => assert!(false, "unexpected ix {ix:?}"),
}
assert_matches!(
try_from_slice_unchecked(&initial_tx.message.instructions[1].data),
Ok(ComputeBudgetInstruction::SetComputeUnitLimit(2820))
);
assert_matches!(
try_from_slice_unchecked(&write_tx.message.instructions[1].data),
Ok(ComputeBudgetInstruction::SetComputeUnitLimit(2670))
);
assert_matches!(
try_from_slice_unchecked(&final_tx.message.instructions[1].data),
Ok(ComputeBudgetInstruction::SetComputeUnitLimit(2970))
);
} else {
assert_eq!(
initial_tx.message.instructions[0].program_id(&initial_tx.message.account_keys),
Expand Down

0 comments on commit 01faab4

Please sign in to comment.