1use crate::types::*;
18use serde::Deserialize;
19use serde::Serialize;
20
21#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
22#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
23pub struct RawProof {
24 pub epoch: EpochParameters,
25 pub local_nonce: LocalNonce,
26 pub cu_id: CUID,
27 pub result_hash: ResultHash,
28}
29
30impl RawProof {
31 pub fn new(
32 epoch: EpochParameters,
33 local_nonce: LocalNonce,
34 cu_id: CUID,
35 result_hash: ResultHash,
36 ) -> Self {
37 Self {
38 epoch,
39 local_nonce,
40 cu_id,
41 result_hash,
42 }
43 }
44}
45
46use std::fmt;
47
48impl fmt::Display for RawProof {
49 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
50 writeln!(f, "{}", self.epoch)?;
51 writeln!(f, "local nonce {:?}", self.local_nonce)?;
52 writeln!(f, "CU id: {:?}", self.cu_id)?;
53 writeln!(f, "result hash: {:?}", self.result_hash)
54 }
55}