Skip to content

Commit

Permalink
fix sv1-mining-device handle_notify manipulation of job_id
Browse files Browse the repository at this point in the history
  • Loading branch information
plebhash committed Jun 19, 2024
1 parent d649b0a commit 61c5726
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions roles/test-utils/sv1-mining-device/src/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ pub(crate) struct Job {

impl Job {
pub fn from_notify(notify_msg: server_to_client::Notify<'_>, extranonce: Vec<u8>) -> Self {
// TODO: Hard coded for demo. Should be properly translated from received Notify message
// Right now, Notify.job_id is a string, but the Job.job_id is a u32 here.
let job_id = 1u32;
let job_id = notify_msg.job_id.parse::<u32>().expect("expect valid job_id on String");

// Convert prev hash from Vec<u8> into expected [u32; 8]
let prev_hash_vec: Vec<u8> = notify_msg.prev_hash.into();
Expand Down

0 comments on commit 61c5726

Please sign in to comment.