forest/lotus_json/
address.rs1use super::*;
5use crate::shim::address::Address;
6
7#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, JsonSchema)]
8#[schemars(rename = "Address")]
9pub struct AddressLotusJson(
10 #[schemars(with = "String")]
11 #[serde(with = "crate::lotus_json::stringify")]
12 Address,
13);
14
15impl HasLotusJson for Address {
16 type LotusJson = AddressLotusJson;
17
18 #[cfg(test)]
19 fn snapshots() -> Vec<(serde_json::Value, Self)> {
20 vec![(json!("f00"), Address::default())]
21 }
22
23 fn into_lotus_json(self) -> Self::LotusJson {
24 AddressLotusJson(self)
25 }
26
27 fn from_lotus_json(AddressLotusJson(address): Self::LotusJson) -> Self {
28 address
29 }
30}