hpl-events 0.1.14

Honeycomb protocol library No-Op program to wrap events
Documentation
pub use hpl_attribute_event::event;
pub use solana_program::{
    account_info::AccountInfo, declare_id, entrypoint::ProgramResult, instruction::Instruction,
    program::invoke, pubkey::Pubkey,
};

declare_id!("EventNxhSA3AcXD14PmXaYUiNQWwoKbLeGHtwydixRzX");

#[cfg(not(feature = "no-entrypoint"))]
use solana_program::entrypoint;

#[cfg(not(feature = "no-entrypoint"))]
entrypoint!(hpl_events);

pub fn hpl_events(
    _program_id: &Pubkey,
    _accounts: &[AccountInfo],
    _instruction_data: &[u8],
) -> ProgramResult {
    Ok(())
}
// #[derive(borsh::BorshSerialize, borsh::BorshDeserialize, PartialEq, Eq, Debug, Clone)]
// pub enum ExampleEvent {
//     Event1,
//     Event2,
// }

// impl ExampleEvent {
//     pub fn to_instruction(&self) -> Instruction {
//         Instruction {
//             program_id: crate::id(),
//             accounts: vec![],
//             data: vec![
//                 crate::id().try_to_vec().unwrap(),
//                 self.try_to_vec().unwrap(),
//             ]
//             .concat(),
//         }
//     }

//     pub fn emit_to<'info>(&self, wrapper_program: AccountInfo<'info>) -> ProgramResult {
//         invoke(&self.to_instruction(), &[wrapper_program.to_account_info()])
//     }

//     pub fn emit<'info>(&self, hpl_events_program: AccountInfo<'info>) -> ProgramResult {
//         if String::from("EvntXY8sSMZhWLdh26y4aePQWH4VqCk13oCBqydpbdy6")
//             != hpl_events_program.key().to_string()
//         {
//             return Err(ProgramError::IncorrectProgramId);
//         };
//         self.emit_to(hpl_events_program)
//     }

//     /// Used as backup for old programs
//     pub fn wrap<'info>(
//         &self,
//         hpl_events_program: AccountInfo<'info>,
//         emitter_program: Pubkey,
//     ) -> ProgramResult {
//         invoke(
//             &Instruction {
//                 program_id: crate::id(),
//                 accounts: vec![],
//                 data: vec![
//                     emitter_program.try_to_vec().unwrap(),
//                     self.try_to_vec().unwrap(),
//                 ]
//                 .concat(),
//             },
//             &[hpl_events_program],
//         )
//     }
// }

// #[event]
// pub enum Event {
//     New,
//     Update,
// }