From 7c4ccfd7af77a92af79fd7e47d3934c5fe683156 Mon Sep 17 00:00:00 2001 From: Hardhat Chad Date: Wed, 15 May 2024 16:57:51 +0000 Subject: [PATCH] mine ix --- src/instruction.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/instruction.rs b/src/instruction.rs index ed105c7..da5d501 100644 --- a/src/instruction.rs +++ b/src/instruction.rs @@ -1,4 +1,5 @@ use bytemuck::{Pod, Zeroable}; +use drillx::Solution; use num_enum::TryFromPrimitive; use shank::ShankInstruction; use solana_program::{ @@ -274,7 +275,7 @@ pub fn deregister(signer: Pubkey) -> Instruction { } /// Builds a mine instruction. -pub fn mine(signer: Pubkey, bus: Pubkey, digest: [u8; 16], nonce: u64) -> Instruction { +pub fn mine(signer: Pubkey, bus: Pubkey, solution: Solution) -> Instruction { let proof = Pubkey::find_program_address(&[PROOF, signer.as_ref()], &crate::id()).0; Instruction { program_id: crate::id(), @@ -289,8 +290,8 @@ pub fn mine(signer: Pubkey, bus: Pubkey, digest: [u8; 16], nonce: u64) -> Instru data: [ OreInstruction::Mine.to_vec(), MineArgs { - digest, - nonce: nonce.to_le_bytes(), + digest: solution.d, + nonce: solution.n, } .to_bytes() .to_vec(),