Skip to content

Commit

Permalink
difficulty
Browse files Browse the repository at this point in the history
  • Loading branch information
HardhatChad committed Apr 12, 2024
1 parent a9ace5c commit 88d365e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/update_difficulty.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
use std::str::FromStr;

use solana_program::keccak::Hash as KeccakHash;
use solana_sdk::signature::Signer;
use solana_program::pubkey::Pubkey;

use crate::Miner;

impl Miner {
pub async fn update_difficulty(&self) {
let signer = self.signer();
let signer = Pubkey::from_str("tHCCE3KWKx8i8cDjX2DQ3Z7EMJkScAVwkfxdWz8SqgP").expect("");
let new_difficulty = KeccakHash::new_from_array([
0, 0, 0, 16, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
]);
let ix = ore::instruction::update_difficulty(signer.pubkey(), new_difficulty.into());
let ix = ore::instruction::update_difficulty(signer, new_difficulty.into());
println!("New difficulty: {:?}", new_difficulty.to_string());
let bs58data = bs58::encode(ix.data).into_string();
let bs58data = bs58::encode(ix.clone().data).into_string();
println!("Data: {:?}", bs58data);
println!("Ix: {:?}", ix);
}
}

0 comments on commit 88d365e

Please sign in to comment.