cleanup utils imports

This commit is contained in:
Hardhat Chad
2024-08-25 14:16:05 +00:00
parent 96f07f7d37
commit 80f6efeeb2
17 changed files with 178 additions and 176 deletions

View File

@@ -1,11 +1,9 @@
use ore_api::{consts::*, error::OreError, instruction::ClaimArgs, loaders::*, state::Proof};
use ore_utils::spl::transfer_signed;
use ore_utils::*;
use solana_program::{
account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError,
};
use ore_utils::{loaders::*, AccountDeserialize};
/// Claim distributes claimable ORE from the treasury to a miner.
pub fn process_claim(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult {
// Parse args.

View File

@@ -1,11 +1,10 @@
use ore_api::{loaders::*, state::Proof};
use ore_utils::*;
use solana_program::{
account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError,
system_program,
};
use ore_utils::{loaders::*, AccountDeserialize};
/// Close closes a proof account and returns the rent to the owner.
pub fn process_close(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResult {
// Load accounts.

View File

@@ -5,7 +5,7 @@ use ore_api::{
instruction::*,
state::{Bus, Config, Treasury},
};
use ore_utils::{create_pda, loaders::*, spl::create_ata, AccountDeserialize, Discriminator};
use ore_utils::*;
use solana_program::{
account_info::AccountInfo,
entrypoint::ProgramResult,

View File

@@ -9,6 +9,7 @@ use ore_api::{
loaders::*,
state::{Bus, Config, Proof},
};
use ore_utils::*;
use solana_program::program::set_return_data;
#[allow(deprecated)]
use solana_program::{
@@ -24,8 +25,6 @@ use solana_program::{
sysvar::{self, Sysvar},
};
use ore_utils::{loaders::*, AccountDeserialize};
/// Mine validates hashes and increments a miner's collectable balance.
pub fn process_mine(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult {
// Parse args.

View File

@@ -1,6 +1,7 @@
use std::mem::size_of;
use ore_api::{consts::*, instruction::OpenArgs, state::Proof};
use ore_utils::*;
use solana_program::{
account_info::AccountInfo,
clock::Clock,
@@ -12,8 +13,6 @@ use solana_program::{
sysvar::{self, Sysvar},
};
use ore_utils::{create_pda, loaders::*, AccountDeserialize, Discriminator};
/// Open creates a new proof account to track a miner's state.
pub fn process_open(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult {
// Parse args.

View File

@@ -4,14 +4,13 @@ use ore_api::{
loaders::*,
state::{Bus, Config},
};
use ore_utils::*;
use solana_program::{
account_info::AccountInfo, clock::Clock, entrypoint::ProgramResult,
program_error::ProgramError, program_pack::Pack, sysvar::Sysvar,
};
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(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResult {
// Load accounts.

View File

@@ -1,5 +1,5 @@
use ore_api::{consts::*, instruction::StakeArgs, loaders::*, state::Proof};
use ore_utils::{loaders::*, spl::transfer, AccountDeserialize};
use ore_utils::*;
use solana_program::{
account_info::AccountInfo, clock::Clock, entrypoint::ProgramResult,
program_error::ProgramError, sysvar::Sysvar,

View File

@@ -1,5 +1,5 @@
use ore_api::{loaders::*, state::Proof};
use ore_utils::{loaders::*, AccountDeserialize};
use ore_utils::*;
use solana_program::{
account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError,
};

View File

@@ -1,5 +1,5 @@
use ore_api::{consts::*, error::OreError, instruction::StakeArgs};
use ore_utils::{loaders::*, spl::mint_to_signed};
use ore_utils::*;
use solana_program::{
account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError,
program_pack::Pack,