diff --git a/src/blocks/tipset.rs b/src/blocks/tipset.rs index 8b8a2457b9f..a0f2cb5a5fa 100644 --- a/src/blocks/tipset.rs +++ b/src/blocks/tipset.rs @@ -649,12 +649,8 @@ mod lotus_json { #[schemars(rename = "TipsetInner")] #[serde(rename_all = "PascalCase")] struct TipsetLotusJsonInner { - #[serde(with = "crate::lotus_json")] - #[schemars(with = "LotusJson")] - cids: TipsetKey, - #[serde(with = "crate::lotus_json")] - #[schemars(with = "LotusJson>")] - blocks: NonEmpty, + cids: ::LotusJson, + blocks: as HasLotusJson>::LotusJson, height: i64, } @@ -669,7 +665,10 @@ mod lotus_json { height: _ignored1, } = Deserialize::deserialize(deserializer)?; - Ok(Self(Tipset::new(blocks).map_err(D::Error::custom)?)) + Ok(Self( + Tipset::new(NonEmpty::::from_lotus_json(blocks)) + .map_err(D::Error::custom)?, + )) } } @@ -680,9 +679,9 @@ mod lotus_json { { let Self(tipset) = self; TipsetLotusJsonInner { - cids: tipset.key().clone(), + cids: tipset.key().clone().into_lotus_json(), + blocks: tipset.block_headers().clone().into_lotus_json(), height: tipset.epoch(), - blocks: tipset.block_headers().clone(), } .serialize(serializer) }