Skip to main content

forest/lotus_json/
vrf_proof.rs

1// Copyright 2019-2026 ChainSafe Systems
2// SPDX-License-Identifier: Apache-2.0, MIT
3
4use super::*;
5use crate::blocks::VRFProof;
6
7impl HasLotusJson for VRFProof {
8    type LotusJson = <Vec<u8> as HasLotusJson>::LotusJson;
9
10    #[cfg(test)]
11    fn snapshots() -> Vec<(serde_json::Value, Self)> {
12        vec![(
13            json!("aGVsbG8gd29ybGQh"),
14            VRFProof(Vec::from_iter(*b"hello world!")),
15        )]
16    }
17
18    fn into_lotus_json(self) -> Self::LotusJson {
19        let Self(vec) = self;
20        vec.into_lotus_json()
21    }
22
23    fn from_lotus_json(lotus_json: Self::LotusJson) -> Self {
24        Self(HasLotusJson::from_lotus_json(lotus_json))
25    }
26}