use alloc::vec::Vec;
use binary_sv2::{
binary_codec_sv2, Deserialize, Seq064K, Serialize, ShortTxId, Str0255, B0255, B064K, U256,
};
use core::convert::TryInto;
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
#[repr(C)]
pub struct DeclareMiningJob<'decoder> {
pub request_id: u32,
pub mining_job_token: B0255<'decoder>,
pub version: u32,
pub coinbase_prefix: B064K<'decoder>,
pub coinbase_suffix: B064K<'decoder>,
pub tx_short_hash_nonce: u64,
pub tx_short_hash_list: Seq064K<'decoder, ShortTxId<'decoder>>,
pub tx_hash_list_hash: U256<'decoder>,
pub excess_data: B064K<'decoder>,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
#[repr(C)]
pub struct DeclareMiningJobSuccess<'decoder> {
pub request_id: u32,
pub new_mining_job_token: B0255<'decoder>,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
#[repr(C)]
pub struct DeclareMiningJobError<'decoder> {
pub request_id: u32,
pub error_code: Str0255<'decoder>,
pub error_details: B064K<'decoder>,
}