Native/builtin programs now receive an InvokeContext

This commit is contained in:
Michael Vines
2020-10-28 20:21:50 -07:00
parent ca00197009
commit df8dab9d2b
36 changed files with 402 additions and 251 deletions

View File

@@ -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,