mirror of
https://github.com/d0zingcat/ore.git
synced 2026-06-02 15:11:17 +00:00
resolve diffs
This commit is contained in:
@@ -50,8 +50,11 @@ pub enum OreInstruction {
|
||||
|
||||
#[account(0, name = "ore_program", desc = "Ore program")]
|
||||
#[account(1, name = "signer", desc = "Signer", signer)]
|
||||
#[account(2, name = "proof", desc = "Ore proof account", writable)]
|
||||
#[account(3, name = "system_program", desc = "Solana system program")]
|
||||
#[account(2, name = "miner", desc = "Address to be initialized as the miner")]
|
||||
#[account(3, name = "payer", desc = "Account to pay for account creation", writable, signer)]
|
||||
#[account(4, name = "proof", desc = "Ore proof account", writable)]
|
||||
#[account(5, name = "system_program", desc = "Solana system program")]
|
||||
#[account(6, name = "slot_hashes", desc = "Solana slot hashes sysvar")]
|
||||
Open = 4,
|
||||
|
||||
#[account(0, name = "ore_program", desc = "Ore program")]
|
||||
@@ -228,6 +231,21 @@ pub fn close(signer: Pubkey) -> Instruction {
|
||||
}
|
||||
}
|
||||
|
||||
/// Builds a crown instruction.
|
||||
pub fn crown(signer: Pubkey, current_top_staker: Pubkey) -> Instruction {
|
||||
let proof_pda = Pubkey::find_program_address(&[PROOF, signer.as_ref()], &crate::id());
|
||||
Instruction {
|
||||
program_id: crate::id(),
|
||||
accounts: vec![
|
||||
AccountMeta::new(signer, true),
|
||||
AccountMeta::new(CONFIG_ADDRESS, false),
|
||||
AccountMeta::new_readonly(current_top_staker, false),
|
||||
AccountMeta::new_readonly(proof_pda.0, false),
|
||||
],
|
||||
data: OreInstruction::Crown.to_vec(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Builds a mine instruction.
|
||||
pub fn mine(
|
||||
miner: Pubkey,
|
||||
|
||||
Reference in New Issue
Block a user