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 524bb8c commit a9ace5c
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/update_difficulty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,13 @@ use crate::Miner;
impl Miner {
pub async fn update_difficulty(&self) {
let signer = self.signer();
// let new_difficulty = KeccakHash::new_from_array([
// 0, 0, 0, 64, 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 new_difficulty = KeccakHash::new_from_array([
0, 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, 255, 255, 255,
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 bs58data = bs58::encode(ix.data).into_string();
// println!("Data: {:?}", bs58data);
self.send_and_confirm(&[ix], false, false)
.await
.expect("Transaction failed");
println!("New difficulty: {:?}", new_difficulty.to_string());
let bs58data = bs58::encode(ix.data).into_string();
println!("Data: {:?}", bs58data);
}
}

0 comments on commit a9ace5c

Please sign in to comment.