remove lifetimes

This commit is contained in:
Hardhat Chad
2024-08-25 11:58:08 +00:00
parent 18b87be8ea
commit d164241c40
11 changed files with 32 additions and 72 deletions

View File

@@ -7,7 +7,7 @@ use solana_program::{
use ore_utils::{loaders::*, AccountDeserialize};
/// Claim distributes claimable ORE from the treasury to a miner.
pub fn process_claim<'a, 'info>(accounts: &'a [AccountInfo<'info>], data: &[u8]) -> ProgramResult {
pub fn process_claim(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult {
// Parse args.
let args = ClaimArgs::try_from_bytes(data)?;
let amount = u64::from_le_bytes(args.amount);

View File

@@ -7,7 +7,7 @@ use solana_program::{
use ore_utils::{loaders::*, AccountDeserialize};
/// Close closes a proof account and returns the rent to the owner.
pub fn process_close<'a, 'info>(accounts: &'a [AccountInfo<'info>], _data: &[u8]) -> ProgramResult {
pub fn process_close(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResult {
// Load accounts.
let [signer, proof_info, system_program] = accounts else {
return Err(ProgramError::NotEnoughAccountKeys);

View File

@@ -16,10 +16,7 @@ use solana_program::{
use spl_token::state::Mint;
/// Initialize sets up the ORE program to begin mining.
pub fn process_initialize<'a, 'info>(
accounts: &'a [AccountInfo<'info>],
data: &[u8],
) -> ProgramResult {
pub fn process_initialize(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult {
// Parse args.
let args = InitializeArgs::try_from_bytes(data)?;

View File

@@ -27,7 +27,7 @@ use solana_program::{
use ore_utils::{loaders::*, AccountDeserialize};
/// Mine validates hashes and increments a miner's collectable balance.
pub fn process_mine<'a, 'info>(accounts: &'a [AccountInfo<'info>], data: &[u8]) -> ProgramResult {
pub fn process_mine(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult {
// Parse args.
let args = MineArgs::try_from_bytes(data)?;

View File

@@ -15,7 +15,7 @@ use solana_program::{
use ore_utils::{create_pda, loaders::*, AccountDeserialize, Discriminator};
/// Open creates a new proof account to track a miner's state.
pub fn process_open<'a, 'info>(accounts: &'a [AccountInfo<'info>], data: &[u8]) -> ProgramResult {
pub fn process_open(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult {
// Parse args.
let args = OpenArgs::try_from_bytes(data)?;

View File

@@ -13,7 +13,7 @@ use spl_token::state::Mint;
use ore_utils::{loaders::*, AccountDeserialize};
/// Reset tops up the bus balances, updates the base reward rate, and sets up the ORE program for the next epoch.
pub fn process_reset<'a, 'info>(accounts: &'a [AccountInfo<'info>], _data: &[u8]) -> ProgramResult {
pub fn process_reset(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResult {
// Load accounts.
let [signer, bus_0_info, bus_1_info, bus_2_info, bus_3_info, bus_4_info, bus_5_info, bus_6_info, bus_7_info, config_info, mint_info, treasury_info, treasury_tokens_info, token_program] =
accounts

View File

@@ -6,7 +6,7 @@ use solana_program::{
};
/// Stake deposits ORE into a proof account to earn multiplier.
pub fn process_stake<'a, 'info>(accounts: &'a [AccountInfo<'info>], data: &[u8]) -> ProgramResult {
pub fn process_stake(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult {
// Parse args.
let args = StakeArgs::try_from_bytes(data)?;
let amount = u64::from_le_bytes(args.amount);

View File

@@ -5,10 +5,7 @@ use solana_program::{
};
/// Update changes the miner authority on a proof account.
pub fn process_update<'a, 'info>(
accounts: &'a [AccountInfo<'info>],
_data: &[u8],
) -> ProgramResult {
pub fn process_update(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResult {
// Load accounts.
let [signer, miner_info, proof_info] = accounts else {
return Err(ProgramError::NotEnoughAccountKeys);

View File

@@ -7,10 +7,7 @@ use solana_program::{
use spl_token::state::Mint;
/// Upgrade allows a user to migrate a v1 token to a v2 token at a 1:1 exchange rate.
pub fn process_upgrade<'a, 'info>(
accounts: &'a [AccountInfo<'info>],
data: &[u8],
) -> ProgramResult {
pub fn process_upgrade(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult {
// Parse args
let args = StakeArgs::try_from_bytes(data)?;
let amount = u64::from_le_bytes(args.amount);