1use crate::blocks::VRFProof;
5use fvm_ipld_encoding::tuple::*;
6use get_size2::GetSize;
7
8#[derive(
12 Clone,
13 Debug,
14 PartialEq,
15 Eq,
16 Default,
17 Serialize_tuple,
18 Deserialize_tuple,
19 Hash,
20 PartialOrd,
21 Ord,
22 GetSize,
23)]
24pub struct Ticket {
25 pub vrfproof: VRFProof,
28}
29
30impl Ticket {
31 pub fn new(vrfproof: VRFProof) -> Self {
33 Self { vrfproof }
34 }
35}
36
37#[cfg(test)]
38impl quickcheck::Arbitrary for Ticket {
39 fn arbitrary(g: &mut quickcheck::Gen) -> Self {
40 let fmt_str = format!("===={}=====", u64::arbitrary(g));
41 let vrfproof = VRFProof::new(fmt_str.into_bytes());
42 Self { vrfproof }
43 }
44}