From 4a245eb3f8c2e5c961a9383648aa2a4b8b20fea9 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Fri, 14 Apr 2023 15:40:18 -0700 Subject: [PATCH] nits --- synthesizer/src/block/header/metadata/genesis.rs | 2 +- synthesizer/src/block/header/metadata/serialize.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/synthesizer/src/block/header/metadata/genesis.rs b/synthesizer/src/block/header/metadata/genesis.rs index bca1df6b64..6e9798532a 100644 --- a/synthesizer/src/block/header/metadata/genesis.rs +++ b/synthesizer/src/block/header/metadata/genesis.rs @@ -82,7 +82,7 @@ mod tests { /// Update this method if the contents of the metadata have changed. fn get_expected_size() -> usize { // Metadata size. - 2 + 4 + 8 + 8 + 8 + 8 + 8 + 8 + 8 + 16 + 2 + 8 + 4 + 8 + 16 + 8 + 8 + 8 + 8 + 8 // Add an additional 2 bytes for versioning. + 2 } diff --git a/synthesizer/src/block/header/metadata/serialize.rs b/synthesizer/src/block/header/metadata/serialize.rs index 167eaa350e..8dace646a8 100644 --- a/synthesizer/src/block/header/metadata/serialize.rs +++ b/synthesizer/src/block/header/metadata/serialize.rs @@ -28,11 +28,12 @@ impl Serialize for Metadata { metadata.serialize_field("round", &self.round)?; metadata.serialize_field("height", &self.height)?; metadata.serialize_field("total_supply", &self.total_supply)?; + metadata.serialize_field("cumulative_proof_target", &self.cumulative_proof_target)?; + metadata.serialize_field("coinbase_target", &self.coinbase_target)?; metadata.serialize_field("proof_target", &self.proof_target)?; metadata.serialize_field("last_coinbase_target", &self.last_coinbase_target)?; metadata.serialize_field("last_coinbase_timestamp", &self.last_coinbase_timestamp)?; - metadata.serialize_field("cumulative_proof_target", &self.cumulative_proof_target)?; metadata.serialize_field("timestamp", &self.timestamp)?; metadata.end() } @@ -52,11 +53,11 @@ impl<'de, N: Network> Deserialize<'de> for Metadata { DeserializeExt::take_from_value::(&mut metadata, "round")?, DeserializeExt::take_from_value::(&mut metadata, "height")?, DeserializeExt::take_from_value::(&mut metadata, "total_supply")?, + DeserializeExt::take_from_value::(&mut metadata, "cumulative_proof_target")?, DeserializeExt::take_from_value::(&mut metadata, "coinbase_target")?, DeserializeExt::take_from_value::(&mut metadata, "proof_target")?, DeserializeExt::take_from_value::(&mut metadata, "last_coinbase_target")?, DeserializeExt::take_from_value::(&mut metadata, "last_coinbase_timestamp")?, - DeserializeExt::take_from_value::(&mut metadata, "cumulative_proof_target")?, DeserializeExt::take_from_value::(&mut metadata, "timestamp")?, ) .map_err(de::Error::custom)?)