Remove Entrypoint type

This commit is contained in:
Michael Vines
2020-10-29 16:17:36 -07:00
parent 2664a1f7ef
commit 225bed11c7
13 changed files with 98 additions and 163 deletions

View File

@ -15,8 +15,7 @@ use solana_sdk::{
message::Message,
native_loader,
process_instruction::{
ComputeBudget, ComputeMeter, ErasedProcessInstructionWithContext, Executor, InvokeContext,
Logger, ProcessInstructionWithContext,
ComputeBudget, ComputeMeter, Executor, InvokeContext, Logger, ProcessInstructionWithContext,
},
pubkey::Pubkey,
rent::Rent,
@ -338,6 +337,15 @@ impl std::fmt::Debug for MessageProcessor {
programs: Vec<String>,
native_loader: &'a NativeLoader,
}
// These are just type aliases for work around of Debug-ing above pointers
type ErasedProcessInstructionWithContext = fn(
&'static Pubkey,
&'static [KeyedAccount<'static>],
&'static [u8],
&'static mut dyn InvokeContext,
) -> Result<(), InstructionError>;
// rustc doesn't compile due to bug without this work around
// https://github.com/rust-lang/rust/issues/50280
// https://users.rust-lang.org/t/display-function-pointer/17073/2