Drop lifetimes

This commit is contained in:
Michael Vines 2020-11-01 00:22:04 -07:00
parent 8dd09c7530
commit 2b5e9d1286
7 changed files with 16 additions and 17 deletions

View File

@ -1,18 +1,17 @@
//! Program entrypoint //! Program entrypoint
use solana_program::{ use solana_program::{
account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, info, account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, program_error::ProgramError,
program_error::ProgramError, pubkey::Pubkey, pubkey::Pubkey,
}; };
use std::str::from_utf8; use std::str::from_utf8;
entrypoint!(process_instruction); entrypoint!(process_instruction);
fn process_instruction<'a>( fn process_instruction(
_program_id: &Pubkey, _program_id: &Pubkey,
_accounts: &'a [AccountInfo<'a>], _accounts: &[AccountInfo],
instruction_data: &[u8], instruction_data: &[u8],
) -> ProgramResult { ) -> ProgramResult {
info!("hi");
from_utf8(instruction_data).map_err(|_| ProgramError::InvalidInstructionData)?; from_utf8(instruction_data).map_err(|_| ProgramError::InvalidInstructionData)?;
Ok(()) Ok(())
} }

View File

@ -7,9 +7,9 @@ use solana_program::{
}; };
entrypoint!(process_instruction); entrypoint!(process_instruction);
fn process_instruction<'a>( fn process_instruction(
program_id: &Pubkey, program_id: &Pubkey,
accounts: &'a [AccountInfo<'a>], accounts: &[AccountInfo],
instruction_data: &[u8], instruction_data: &[u8],
) -> ProgramResult { ) -> ProgramResult {
if let Err(error) = Processor::process(program_id, accounts, instruction_data) { if let Err(error) = Processor::process(program_id, accounts, instruction_data) {

View File

@ -5,9 +5,9 @@ use solana_program::{
}; };
entrypoint!(process_instruction); entrypoint!(process_instruction);
fn process_instruction<'a>( fn process_instruction(
program_id: &Pubkey, program_id: &Pubkey,
accounts: &'a [AccountInfo<'a>], accounts: &[AccountInfo],
instruction_data: &[u8], instruction_data: &[u8],
) -> ProgramResult { ) -> ProgramResult {
crate::processor::process_instruction(program_id, accounts, instruction_data)?; crate::processor::process_instruction(program_id, accounts, instruction_data)?;

View File

@ -88,9 +88,9 @@ fn process_request_payment(
} }
/// Process the given transaction instruction /// Process the given transaction instruction
pub fn process_instruction<'a>( pub fn process_instruction(
_program_id: &Pubkey, _program_id: &Pubkey,
account_infos: &'a [AccountInfo<'a>], account_infos: &[AccountInfo],
input: &[u8], input: &[u8],
) -> Result<(), ProgramError> { ) -> Result<(), ProgramError> {
let account_infos_iter = &mut account_infos.iter(); let account_infos_iter = &mut account_infos.iter();

View File

@ -7,9 +7,9 @@ use solana_program::{
}; };
entrypoint!(process_instruction); entrypoint!(process_instruction);
fn process_instruction<'a>( fn process_instruction(
program_id: &Pubkey, program_id: &Pubkey,
accounts: &'a [AccountInfo<'a>], accounts: &[AccountInfo],
instruction_data: &[u8], instruction_data: &[u8],
) -> ProgramResult { ) -> ProgramResult {
if let Err(error) = Processor::process(program_id, accounts, instruction_data) { if let Err(error) = Processor::process(program_id, accounts, instruction_data) {

View File

@ -7,9 +7,9 @@ use solana_program::{
}; };
entrypoint!(process_instruction); entrypoint!(process_instruction);
fn process_instruction<'a>( fn process_instruction(
program_id: &Pubkey, program_id: &Pubkey,
accounts: &'a [AccountInfo<'a>], accounts: &[AccountInfo],
instruction_data: &[u8], instruction_data: &[u8],
) -> ProgramResult { ) -> ProgramResult {
if let Err(error) = Processor::process(program_id, accounts, instruction_data) { if let Err(error) = Processor::process(program_id, accounts, instruction_data) {

View File

@ -7,9 +7,9 @@ use solana_program::{
}; };
entrypoint!(process_instruction); entrypoint!(process_instruction);
fn process_instruction<'a>( fn process_instruction(
program_id: &Pubkey, program_id: &Pubkey,
accounts: &'a [AccountInfo<'a>], accounts: &[AccountInfo],
instruction_data: &[u8], instruction_data: &[u8],
) -> ProgramResult { ) -> ProgramResult {
if let Err(error) = Processor::process(program_id, accounts, instruction_data) { if let Err(error) = Processor::process(program_id, accounts, instruction_data) {