mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-13 23:16:52 +00:00
mine ix
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user