Delete deprecated interfaces (#119)

* delete deprecated interfaces

* bump version
This commit is contained in:
Hardhat Chad
2025-03-23 11:41:01 -05:00
committed by GitHub
parent 34b7de191c
commit 52b5dfd17e
12 changed files with 13 additions and 147 deletions

View File

@@ -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(),
}
}