1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use crate::api::porep_config::PoRepConfig;
use crate::api::porep_proof_partitions::PoRepProofPartitions;
use crate::api::post_config::PoStConfig;
use crate::api::post_proof_partitions::PoStProofPartitions;
use crate::api::sector_size::SectorSize;

#[derive(Clone, Copy, Debug)]
pub struct SectorClass(
    pub SectorSize,
    pub PoRepProofPartitions,
    pub PoStProofPartitions,
);

impl From<SectorClass> for PoStConfig {
    fn from(x: SectorClass) -> Self {
        match x {
            SectorClass(ss, _, ppp) => PoStConfig(ss, ppp),
        }
    }
}

impl From<SectorClass> for PoRepConfig {
    fn from(x: SectorClass) -> Self {
        match x {
            SectorClass(ss, ppp, _) => PoRepConfig(ss, ppp),
        }
    }
}