From 0cf37e81ec0e790887b0d4a875af3328ccd195dc Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 10 Jul 2024 13:49:50 -0700 Subject: [PATCH] build mine ix with proof authority --- api/src/instruction.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/api/src/instruction.rs b/api/src/instruction.rs index 5d4e25b..e2b9f49 100644 --- a/api/src/instruction.rs +++ b/api/src/instruction.rs @@ -230,12 +230,17 @@ pub fn close(signer: Pubkey) -> Instruction { } /// Builds a mine instruction. -pub fn mine(signer: Pubkey, bus: Pubkey, solution: Solution) -> Instruction { - let proof = Pubkey::find_program_address(&[PROOF, signer.as_ref()], &crate::id()).0; +pub fn mine( + miner: Pubkey, + proof_authority: Pubkey, + bus: Pubkey, + solution: Solution, +) -> Instruction { + let proof = Pubkey::find_program_address(&[PROOF, proof_authority.as_ref()], &crate::id()).0; Instruction { program_id: crate::id(), accounts: vec![ - AccountMeta::new(signer, true), + AccountMeta::new(miner, true), AccountMeta::new(bus, false), AccountMeta::new_readonly(CONFIG_ADDRESS, false), AccountMeta::new(proof, false),