From 833ad20b01195d04528226d361437367b6992cc6 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 25 Sep 2020 17:20:28 -0700 Subject: [PATCH] Add Builtin AbiExample --- runtime/src/bank.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index bf27258b3b..f815cfc7e6 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -137,6 +137,7 @@ pub enum Entrypoint { Program(ProcessInstruction), Loader(ProcessInstructionWithContext), } + #[derive(Clone)] pub struct Builtin { pub name: String, @@ -187,6 +188,17 @@ impl CowCachedExecutors { } } +#[cfg(RUSTC_WITH_SPECIALIZATION)] +impl AbiExample for Builtin { + fn example() -> Self { + Self { + name: String::default(), + id: Pubkey::default(), + entrypoint: Entrypoint::Program(|_, _, _| Ok(())), + } + } +} + #[derive(Clone)] pub struct Builtins { /// Builtin programs that are always available