use alloc::vec::Vec;
use binary_sv2::{self, Deserialize, Serialize, U256};
use core::{convert::TryInto, fmt};
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct SetNewPrevHash<'decoder> {
pub channel_id: u32,
pub job_id: u32,
pub prev_hash: U256<'decoder>,
pub min_ntime: u32,
pub nbits: u32,
}
impl fmt::Display for SetNewPrevHash<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"SetNewPrevHash(channel_id={}, job_id={}, prev_hash={}, min_ntime={}, nbits=0x{:08x})",
self.channel_id, self.job_id, self.prev_hash, self.min_ntime, self.nbits
)
}
}