cleanup imports

This commit is contained in:
Hardhat Chad
2024-09-27 07:04:29 +00:00
parent 799676863b
commit 5bd4a467d6
8 changed files with 2 additions and 33 deletions

View File

@@ -1,7 +1,4 @@
use ore_api::{consts::*, error::OreError, instruction::*, loaders::*, state::Proof};
use solana_program::{
account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError,
};
use steel::*;
/// Claim distributes claimable ORE from the treasury to a miner.

View File

@@ -1,8 +1,5 @@
use ore_api::state::Proof;
use solana_program::{
account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError,
system_program,
};
use solana_program::system_program;
use steel::*;
/// Close closes a proof account and returns the rent to the owner.

View File

@@ -11,12 +11,7 @@ use ore_api::{
use solana_program::program::set_return_data;
#[allow(deprecated)]
use solana_program::{
account_info::AccountInfo,
clock::Clock,
entrypoint::ProgramResult,
keccak::hashv,
program_error::ProgramError,
pubkey::Pubkey,
sanitize::SanitizeError,
serialize_utils::{read_pubkey, read_u16},
slot_hashes::SlotHash,

View File

@@ -2,11 +2,7 @@ use std::mem::size_of;
use ore_api::{consts::*, instruction::Open, state::Proof};
use solana_program::{
account_info::AccountInfo,
clock::Clock,
entrypoint::ProgramResult,
keccak::hashv,
program_error::ProgramError,
slot_hashes::SlotHash,
system_program,
sysvar::{self, Sysvar},

View File

@@ -4,7 +4,6 @@ use ore_api::{
loaders::*,
state::{Bus, Config},
};
use solana_program::clock::Clock;
use steel::*;
/// Reset tops up the bus balances, updates the base reward rate, and sets up the ORE program for the next epoch.

View File

@@ -1,8 +1,4 @@
use ore_api::{consts::*, instruction::Stake, loaders::*, state::Proof};
use solana_program::{
account_info::AccountInfo, clock::Clock, entrypoint::ProgramResult,
program_error::ProgramError, sysvar::Sysvar,
};
use steel::*;
/// Stake deposits ORE into a proof account to earn multiplier.

View File

@@ -1,7 +1,4 @@
use ore_api::state::Proof;
use solana_program::{
account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError,
};
use steel::*;
/// Update changes the miner authority on a proof account.

View File

@@ -1,9 +1,4 @@
use ore_api::{consts::*, error::OreError, instruction::Stake};
use solana_program::{
account_info::AccountInfo, entrypoint::ProgramResult, program_error::ProgramError,
program_pack::Pack,
};
use spl_token::state::Mint;
use steel::*;
/// Upgrade allows a user to migrate a v1 token to a v2 token at a 1:1 exchange rate.
@@ -24,7 +19,7 @@ pub fn process_upgrade(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResu
.to_token_account()?
.check(|t| t.owner == *signer_info.key)?
.check(|t| t.mint == MINT_ADDRESS)?;
mint_info
let mint = mint_info
.is_writable()?
.has_address(&MINT_ADDRESS)?
.to_mint()?;
@@ -62,14 +57,11 @@ pub fn process_upgrade(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResu
let amount_to_mint = amount.saturating_mul(100);
// Cap at max supply.
let mint_data = mint_info.data.borrow();
let mint = Mint::unpack(&mint_data)?;
if mint.supply.saturating_add(amount_to_mint).gt(&MAX_SUPPLY) {
return Err(OreError::MaxSupply.into());
}
// Mint to the beneficiary account
drop(mint_data);
mint_to_signed(
mint_info,
beneficiary_info,