Native/builtin programs now receive an InvokeContext
This commit is contained in:
@ -17,17 +17,16 @@ use solana_rbpf::{
|
||||
memory_region::MemoryRegion,
|
||||
vm::{Config, EbpfVm, Executable, InstructionMeter},
|
||||
};
|
||||
use solana_runtime::{
|
||||
feature_set::{bpf_just_in_time_compilation, compute_budget_balancing},
|
||||
process_instruction::{ComputeMeter, Executor, InvokeContext},
|
||||
};
|
||||
use solana_sdk::{
|
||||
bpf_loader, bpf_loader_deprecated,
|
||||
decode_error::DecodeError,
|
||||
entrypoint::SUCCESS,
|
||||
feature_set::compute_budget_balancing,
|
||||
feature_set::{bpf_just_in_time_compilation, compute_budget_balancing},
|
||||
instruction::InstructionError,
|
||||
keyed_account::{is_executable, next_keyed_account, KeyedAccount},
|
||||
loader_instruction::LoaderInstruction,
|
||||
process_instruction::{ComputeMeter, Executor, InvokeContext},
|
||||
program_utils::limited_deserialize,
|
||||
pubkey::Pubkey,
|
||||
};
|
||||
@ -326,14 +325,15 @@ impl Executor for BPFExecutor {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use rand::Rng;
|
||||
use solana_runtime::{
|
||||
bpf_test_utils::MockInvokeContext,
|
||||
use solana_runtime::message_processor::{Executors, ThisInvokeContext};
|
||||
use solana_sdk::{
|
||||
account::Account,
|
||||
feature_set::FeatureSet,
|
||||
message_processor::{Executors, ThisInvokeContext},
|
||||
process_instruction::ComputeBudget,
|
||||
instruction::InstructionError,
|
||||
process_instruction::{ComputeBudget, MockInvokeContext},
|
||||
rent::Rent,
|
||||
};
|
||||
use solana_sdk::{account::Account, instruction::InstructionError, pubkey::Pubkey, rent::Rent};
|
||||
use std::{fs::File, io::Read, ops::Range};
|
||||
use std::{cell::RefCell, fs::File, io::Read, ops::Range, rc::Rc};
|
||||
|
||||
struct TestInstructionMeter {
|
||||
remaining: u64,
|
||||
|
@ -7,22 +7,20 @@ use solana_rbpf::{
|
||||
memory_region::{AccessType, MemoryMapping},
|
||||
vm::{EbpfVm, Syscall, SyscallObject},
|
||||
};
|
||||
use solana_runtime::{
|
||||
feature_set::{
|
||||
pubkey_log_syscall_enabled, ristretto_mul_syscall_enabled, sha256_syscall_enabled,
|
||||
},
|
||||
message_processor::MessageProcessor,
|
||||
process_instruction::{ComputeMeter, InvokeContext, Logger},
|
||||
};
|
||||
use solana_runtime::message_processor::MessageProcessor;
|
||||
use solana_sdk::{
|
||||
account::Account,
|
||||
account_info::AccountInfo,
|
||||
bpf_loader, bpf_loader_deprecated,
|
||||
bpf_loader_deprecated,
|
||||
entrypoint::{MAX_PERMITTED_DATA_INCREASE, SUCCESS},
|
||||
feature_set::{
|
||||
pubkey_log_syscall_enabled, ristretto_mul_syscall_enabled, sha256_syscall_enabled,
|
||||
},
|
||||
hash::{Hasher, HASH_BYTES},
|
||||
instruction::{AccountMeta, Instruction, InstructionError},
|
||||
keyed_account::KeyedAccount,
|
||||
message::Message,
|
||||
process_instruction::{ComputeMeter, InvokeContext, Logger},
|
||||
program_error::ProgramError,
|
||||
pubkey::{Pubkey, PubkeyError},
|
||||
};
|
||||
@ -1351,8 +1349,11 @@ fn call<'a>(
|
||||
mod tests {
|
||||
use super::*;
|
||||
use solana_rbpf::memory_region::MemoryRegion;
|
||||
use solana_runtime::bpf_test_utils::{MockComputeMeter, MockLogger};
|
||||
use solana_sdk::hash::hashv;
|
||||
use solana_sdk::{
|
||||
bpf_loader,
|
||||
hash::hashv,
|
||||
process_instruction::{MockComputeMeter, MockLogger},
|
||||
};
|
||||
use std::str::FromStr;
|
||||
|
||||
macro_rules! assert_access_violation {
|
||||
|
Reference in New Issue
Block a user