solitaire: expose entrypoint and relax lifetimes

The current lifetimes 'a/'b restrict the &data and &program_id lifetimes which makes the
entrypoint unusable in solana_test_program's processor!() harness, which expects the more
relaxed (but equivelent for us) type of:

    fn processor<'a, 'b: 'a, 'c, 'd>(
      program_id: &'c Pubkey,
      accounts:   &'a [AccountInfo<'b>],
      data:       &'d [u8]
    )

It has no effect on our current programs.

Change-Id: Ia657462141165064c629fdff02b5ec451aab50f0
This commit is contained in:
Reisen 2021-12-08 14:28:29 +00:00 committed by Reisen
parent 982ce08c4a
commit 7f1c7ec62f
1 changed files with 2 additions and 2 deletions

View File

@ -98,7 +98,7 @@ macro_rules! solitaire {
} }
} }
pub fn solitaire<'a, 'b: 'a>(p: &Pubkey, a: &'a [AccountInfo<'b>], d: &[u8]) -> ProgramResult { pub fn solitaire(p: &Pubkey, a: &[AccountInfo], d: &[u8]) -> ProgramResult {
trace!("{} {} built with {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"), solitaire::PKG_NAME_VERSION); trace!("{} {} built with {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"), solitaire::PKG_NAME_VERSION);
if let Err(err) = dispatch(p, a, d) { if let Err(err) = dispatch(p, a, d) {
solana_program::msg!("Error: {:?}", err); solana_program::msg!("Error: {:?}", err);
@ -108,7 +108,7 @@ macro_rules! solitaire {
} }
} }
use instruction::solitaire; pub use instruction::solitaire;
#[cfg(not(feature = "no-entrypoint"))] #[cfg(not(feature = "no-entrypoint"))]
solana_program::entrypoint!(solitaire); solana_program::entrypoint!(solitaire);
} }