* Native/builtin programs now receive an InvokeContext (cherry picked from commitdf8dab9d2b) * Remove MessageProcessor::loaders (cherry picked from commit2664a1f7ef) * Remove Entrypoint type (cherry picked from commit225bed11c7) * Remove programs clone() (cherry picked from commit33884d847a) * Add sol_log_compute_units syscall (cherry picked from commit66e51a7363) * Add Bank::set_bpf_compute_budget() (cherry picked from commit7d686b72a0) * Rebase Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
@@ -86,15 +86,19 @@ macro_rules! declare_name {
|
||||
/// # // wrapper is used so that the macro invocation occurs in the item position
|
||||
/// # // rather than in the statement position which isn't allowed.
|
||||
/// # mod item_wrapper {
|
||||
/// use solana_sdk::keyed_account::KeyedAccount;
|
||||
/// use solana_sdk::instruction::InstructionError;
|
||||
/// use solana_sdk::pubkey::Pubkey;
|
||||
/// use solana_sdk::declare_program;
|
||||
/// use solana_sdk::{
|
||||
/// declare_program,
|
||||
/// instruction::InstructionError,
|
||||
/// keyed_account::KeyedAccount,
|
||||
/// process_instruction::InvokeContext,
|
||||
/// pubkey::Pubkey,
|
||||
/// };
|
||||
///
|
||||
/// fn my_process_instruction(
|
||||
/// program_id: &Pubkey,
|
||||
/// keyed_accounts: &[KeyedAccount],
|
||||
/// instruction_data: &[u8],
|
||||
/// invoke_context: &mut dyn InvokeContext,
|
||||
/// ) -> Result<(), InstructionError> {
|
||||
/// // Process an instruction
|
||||
/// Ok(())
|
||||
@@ -117,15 +121,19 @@ macro_rules! declare_name {
|
||||
/// # // wrapper is used so that the macro invocation occurs in the item position
|
||||
/// # // rather than in the statement position which isn't allowed.
|
||||
/// # mod item_wrapper {
|
||||
/// use solana_sdk::keyed_account::KeyedAccount;
|
||||
/// use solana_sdk::instruction::InstructionError;
|
||||
/// use solana_sdk::pubkey::Pubkey;
|
||||
/// use solana_sdk::declare_program;
|
||||
/// use solana_sdk::{
|
||||
/// declare_program,
|
||||
/// instruction::InstructionError,
|
||||
/// keyed_account::KeyedAccount,
|
||||
/// process_instruction::InvokeContext,
|
||||
/// pubkey::Pubkey,
|
||||
/// };
|
||||
///
|
||||
/// fn my_process_instruction(
|
||||
/// program_id: &Pubkey,
|
||||
/// keyed_accounts: &[KeyedAccount],
|
||||
/// instruction_data: &[u8],
|
||||
/// invoke_context: &mut dyn InvokeContext,
|
||||
/// ) -> Result<(), InstructionError> {
|
||||
/// // Process an instruction
|
||||
/// Ok(())
|
||||
@@ -152,8 +160,9 @@ macro_rules! declare_program(
|
||||
program_id: &$crate::pubkey::Pubkey,
|
||||
keyed_accounts: &[$crate::keyed_account::KeyedAccount],
|
||||
instruction_data: &[u8],
|
||||
invoke_context: &mut dyn $crate::process_instruction::InvokeContext,
|
||||
) -> Result<(), $crate::instruction::InstructionError> {
|
||||
$entrypoint(program_id, keyed_accounts, instruction_data)
|
||||
$entrypoint(program_id, keyed_accounts, instruction_data, invoke_context)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user