Skip to main content

forest/lotus_json/
registered_po_st_proof.rs

1// Copyright 2019-2026 ChainSafe Systems
2// SPDX-License-Identifier: Apache-2.0, MIT
3
4use crate::shim::sector::RegisteredPoStProof;
5use fvm_shared4::sector::RegisteredPoStProof as RegisteredPoStProofV4;
6
7use super::*;
8
9impl HasLotusJson for RegisteredPoStProof {
10    type LotusJson = i64;
11
12    #[cfg(test)]
13    fn snapshots() -> Vec<(serde_json::Value, Self)> {
14        vec![(
15            json!(0),
16            RegisteredPoStProof::from(RegisteredPoStProofV4::StackedDRGWinning2KiBV1),
17        )]
18    }
19
20    fn into_lotus_json(self) -> Self::LotusJson {
21        i64::from(RegisteredPoStProofV4::from(self))
22    }
23
24    fn from_lotus_json(i: Self::LotusJson) -> Self {
25        Self::from(RegisteredPoStProofV4::from(i))
26    }
27}