Add Builtin AbiExample

This commit is contained in:
Michael Vines 2020-09-25 17:20:28 -07:00
parent 31696a1d72
commit 833ad20b01
1 changed files with 12 additions and 0 deletions

View File

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