mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-14 07:26:51 +00:00
Delete deprecated interfaces (#119)
* delete deprecated interfaces * bump version
This commit is contained in:
@@ -131,10 +131,6 @@ pub const MINT_ADDRESS: Pubkey =
|
||||
/// The bump of the mint account.
|
||||
pub const MINT_BUMP: u8 = ed25519::derive_program_address(&[MINT, &MINT_NOISE], &PROGRAM_ID).1;
|
||||
|
||||
/// The address of the v1 mint account.
|
||||
#[deprecated(since = "2.6.0", note = "v1 tokens are no longer eligable to upgrade")]
|
||||
pub const MINT_V1_ADDRESS: Pubkey = pubkey!("oreoN2tQbHXVaZsr3pf66A48miqcBXCDJozganhEJgz");
|
||||
|
||||
/// The address of the treasury account.
|
||||
pub const TREASURY_ADDRESS: Pubkey =
|
||||
Pubkey::new_from_array(ed25519::derive_program_address(&[TREASURY], &PROGRAM_ID).0);
|
||||
|
||||
@@ -9,11 +9,7 @@ pub enum OreInstruction {
|
||||
Mine = 2,
|
||||
Open = 3,
|
||||
Reset = 4,
|
||||
#[deprecated(since = "2.4.0", note = "Please stake with the boost program")]
|
||||
Stake = 5,
|
||||
Update = 6,
|
||||
#[deprecated(since = "2.6.0", note = "v1 tokens are no longer eligable to upgrade")]
|
||||
Upgrade = 7,
|
||||
Update = 5,
|
||||
|
||||
// Admin
|
||||
Initialize = 100,
|
||||
@@ -38,68 +34,24 @@ pub struct Mine {
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Open {
|
||||
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
|
||||
pub bump: u8,
|
||||
}
|
||||
pub struct Open {}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Reset {}
|
||||
|
||||
#[deprecated(since = "2.4.0", note = "Please stake with the boost program")]
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Stake {
|
||||
pub amount: [u8; 8],
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Update {}
|
||||
|
||||
#[deprecated(since = "2.6.0", note = "v1 tokens are no longer eligable to upgrade")]
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Upgrade {
|
||||
pub amount: [u8; 8],
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Initialize {
|
||||
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
|
||||
pub bus_0_bump: u8,
|
||||
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
|
||||
pub bus_1_bump: u8,
|
||||
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
|
||||
pub bus_2_bump: u8,
|
||||
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
|
||||
pub bus_3_bump: u8,
|
||||
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
|
||||
pub bus_4_bump: u8,
|
||||
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
|
||||
pub bus_5_bump: u8,
|
||||
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
|
||||
pub bus_6_bump: u8,
|
||||
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
|
||||
pub bus_7_bump: u8,
|
||||
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
|
||||
pub config_bump: u8,
|
||||
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
|
||||
pub metadata_bump: u8,
|
||||
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
|
||||
pub mint_bump: u8,
|
||||
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
|
||||
pub treasury_bump: u8,
|
||||
}
|
||||
pub struct Initialize {}
|
||||
|
||||
instruction!(OreInstruction, Claim);
|
||||
instruction!(OreInstruction, Close);
|
||||
instruction!(OreInstruction, Mine);
|
||||
instruction!(OreInstruction, Open);
|
||||
instruction!(OreInstruction, Reset);
|
||||
instruction!(OreInstruction, Stake);
|
||||
instruction!(OreInstruction, Update);
|
||||
instruction!(OreInstruction, Upgrade);
|
||||
instruction!(OreInstruction, Initialize);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
pub mod consts;
|
||||
pub mod error;
|
||||
pub mod event;
|
||||
#[allow(deprecated)]
|
||||
pub mod instruction;
|
||||
pub mod loaders;
|
||||
pub mod sdk;
|
||||
|
||||
@@ -84,7 +84,6 @@ pub fn mine(
|
||||
}
|
||||
|
||||
/// Builds an open instruction.
|
||||
#[allow(deprecated)]
|
||||
pub fn open(signer: Pubkey, miner: Pubkey, payer: Pubkey) -> Instruction {
|
||||
let proof_pda = proof_pda(signer);
|
||||
Instruction {
|
||||
@@ -97,7 +96,7 @@ pub fn open(signer: Pubkey, miner: Pubkey, payer: Pubkey) -> Instruction {
|
||||
AccountMeta::new_readonly(solana_program::system_program::ID, false),
|
||||
AccountMeta::new_readonly(sysvar::slot_hashes::ID, false),
|
||||
],
|
||||
data: Open { bump: proof_pda.1 }.to_bytes(),
|
||||
data: Open {}.to_bytes(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,27 +124,6 @@ pub fn reset(signer: Pubkey) -> Instruction {
|
||||
}
|
||||
}
|
||||
|
||||
/// Build a stake instruction.
|
||||
#[allow(deprecated)]
|
||||
#[deprecated(since = "2.4.0", note = "Please stake with the boost program")]
|
||||
pub fn stake(signer: Pubkey, sender: Pubkey, amount: u64) -> Instruction {
|
||||
let proof = proof_pda(signer).0;
|
||||
Instruction {
|
||||
program_id: crate::ID,
|
||||
accounts: vec![
|
||||
AccountMeta::new(signer, true),
|
||||
AccountMeta::new(proof, false),
|
||||
AccountMeta::new(sender, false),
|
||||
AccountMeta::new(TREASURY_TOKENS_ADDRESS, false),
|
||||
AccountMeta::new_readonly(spl_token::ID, false),
|
||||
],
|
||||
data: Stake {
|
||||
amount: amount.to_le_bytes(),
|
||||
}
|
||||
.to_bytes(),
|
||||
}
|
||||
}
|
||||
|
||||
// Build an update instruction.
|
||||
pub fn update(signer: Pubkey, miner: Pubkey) -> Instruction {
|
||||
let proof = proof_pda(signer).0;
|
||||
@@ -160,30 +138,7 @@ pub fn update(signer: Pubkey, miner: Pubkey) -> Instruction {
|
||||
}
|
||||
}
|
||||
|
||||
// Build an upgrade instruction.
|
||||
#[allow(deprecated)]
|
||||
#[deprecated(since = "2.6.0", note = "v1 tokens are no longer eligable to upgrade")]
|
||||
pub fn upgrade(signer: Pubkey, beneficiary: Pubkey, sender: Pubkey, amount: u64) -> Instruction {
|
||||
Instruction {
|
||||
program_id: crate::ID,
|
||||
accounts: vec![
|
||||
AccountMeta::new(signer, true),
|
||||
AccountMeta::new(beneficiary, false),
|
||||
AccountMeta::new(MINT_ADDRESS, false),
|
||||
AccountMeta::new(MINT_V1_ADDRESS, false),
|
||||
AccountMeta::new(sender, false),
|
||||
AccountMeta::new(TREASURY_ADDRESS, false),
|
||||
AccountMeta::new_readonly(spl_token::ID, false),
|
||||
],
|
||||
data: Upgrade {
|
||||
amount: amount.to_le_bytes(),
|
||||
}
|
||||
.to_bytes(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Builds an initialize instruction.
|
||||
#[allow(deprecated)]
|
||||
pub fn initialize(signer: Pubkey) -> Instruction {
|
||||
let bus_pdas = [
|
||||
bus_pda(0),
|
||||
@@ -229,20 +184,6 @@ pub fn initialize(signer: Pubkey) -> Instruction {
|
||||
AccountMeta::new_readonly(mpl_token_metadata::ID, false),
|
||||
AccountMeta::new_readonly(sysvar::rent::ID, false),
|
||||
],
|
||||
data: Initialize {
|
||||
bus_0_bump: bus_pdas[0].1,
|
||||
bus_1_bump: bus_pdas[1].1,
|
||||
bus_2_bump: bus_pdas[2].1,
|
||||
bus_3_bump: bus_pdas[3].1,
|
||||
bus_4_bump: bus_pdas[4].1,
|
||||
bus_5_bump: bus_pdas[5].1,
|
||||
bus_6_bump: bus_pdas[6].1,
|
||||
bus_7_bump: bus_pdas[7].1,
|
||||
config_bump: config_pda.1,
|
||||
metadata_bump: metadata_pda.1,
|
||||
mint_bump: mint_pda.1,
|
||||
treasury_bump: treasury_pda.1,
|
||||
}
|
||||
.to_bytes(),
|
||||
data: Initialize {}.to_bytes(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,8 @@ pub struct Config {
|
||||
/// The minimum accepted difficulty.
|
||||
pub min_difficulty: u64,
|
||||
|
||||
/// The largest known stake balance on the network from the last epoch.
|
||||
#[deprecated(since = "2.4.0", note = "Please stake with the boost program")]
|
||||
pub top_balance: u64,
|
||||
/// Buffer for possible future use.
|
||||
pub _buffer: [u8; 8],
|
||||
}
|
||||
|
||||
account!(OreAccount, Config);
|
||||
|
||||
@@ -22,9 +22,8 @@ pub struct Proof {
|
||||
/// The last time this account provided a hash.
|
||||
pub last_hash_at: i64,
|
||||
|
||||
/// The last time stake was deposited into this account.
|
||||
#[deprecated(since = "2.4.0", note = "Please stake with the boost program")]
|
||||
pub last_stake_at: i64,
|
||||
/// Buffer for possible future use.
|
||||
pub _buffer: [u8; 8],
|
||||
|
||||
/// The keypair which has permission to submit hashes for mining.
|
||||
pub miner: Pubkey,
|
||||
|
||||
Reference in New Issue
Block a user