-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup - mock_process_instruction() (#31088)
* Uses declare_process_instruction!() in all tests. * Adds post_adjustments to mock_process_instruction(). Removes "solana_sbf_rust_external_spend" from assert_instruction_count() as it panics.
- Loading branch information
Showing
13 changed files
with
252 additions
and
423 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
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 |
---|---|---|
@@ -1,16 +1,6 @@ | ||
use {solana_program_runtime::invoke_context::InvokeContext, solana_sdk::feature_set}; | ||
|
||
pub fn process_instruction( | ||
invoke_context: &mut InvokeContext, | ||
) -> Result<(), Box<dyn std::error::Error>> { | ||
// Consume compute units if feature `native_programs_consume_cu` is activated, | ||
if invoke_context | ||
.feature_set | ||
.is_active(&feature_set::native_programs_consume_cu::id()) | ||
{ | ||
invoke_context.consume_checked(150)?; | ||
} | ||
use solana_program_runtime::declare_process_instruction; | ||
|
||
declare_process_instruction!(process_instruction, 150, |_invoke_context| { | ||
// Do nothing, compute budget instructions handled by the runtime | ||
Ok(()) | ||
} | ||
}); |
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
Oops, something went wrong.