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