From 2720f3ee4295fbc9c29595b78ff8ca1c7a8b6b91 Mon Sep 17 00:00:00 2001 From: Hardhat Chad Date: Mon, 4 Aug 2025 15:00:37 -0700 Subject: [PATCH] signer --- program/src/mine.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/program/src/mine.rs b/program/src/mine.rs index 2ce35e3..8e2f7ac 100644 --- a/program/src/mine.rs +++ b/program/src/mine.rs @@ -10,11 +10,10 @@ pub fn process_mine(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult // Load accounts. let clock = Clock::get()?; - let [signer_info, authority_info, block_info, miner_info] = accounts else { + let [signer_info, block_info, miner_info] = accounts else { return Err(ProgramError::NotEnoughAccountKeys); }; signer_info.is_signer()?; - authority_info.is_writable()?; let block = block_info .as_account_mut::(&ore_api::ID)? .assert_mut(|b| clock.slot >= b.end_slot)? // Block has stopped trading @@ -22,7 +21,7 @@ pub fn process_mine(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramResult .assert_mut(|b| b.slot_hash != [0; 32])?; // Slot hash is set let miner = miner_info .as_account_mut::(&ore_api::ID)? - .assert_mut(|m| m.authority == *authority_info.key)? // Account belongs to authority + .assert_mut(|m| m.authority == *signer_info.key)? // Account belongs to authority .assert_mut(|m| m.block_id == block.id)? // Only allow miner to submit hashes for their current block .assert_mut(|m| m.hashpower > nonce)?; // Only allow miner to submit nonces for their hashpower range