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
29
30
31
32
33
34
35
36
37
38
// Copyright 2019-2024 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

use crate::lotus_json::HasLotusJson;
use crate::rpc::types::ClaimLotusJson;
use fil_actor_interface::verifreg::Claim;

impl HasLotusJson for Claim {
    type LotusJson = ClaimLotusJson;
    #[cfg(test)]
    fn snapshots() -> Vec<(serde_json::Value, Self)> {
        vec![]
    }
    fn into_lotus_json(self) -> Self::LotusJson {
        ClaimLotusJson {
            size: self.size,
            sector: self.sector,
            data: self.data,
            client: self.client,
            provider: self.provider,
            term_max: self.term_max,
            term_min: self.term_min,
            term_start: self.term_start,
        }
    }
    fn from_lotus_json(lotus_json: Self::LotusJson) -> Self {
        Claim {
            size: lotus_json.size,
            sector: lotus_json.sector,
            data: lotus_json.data,
            client: lotus_json.client,
            provider: lotus_json.provider,
            term_max: lotus_json.term_max,
            term_min: lotus_json.term_min,
            term_start: lotus_json.term_start,
        }
    }
}