Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
raychu86 committed Apr 14, 2023
1 parent 082eef4 commit 4a245eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion synthesizer/src/block/header/metadata/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
5 changes: 3 additions & 2 deletions synthesizer/src/block/header/metadata/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ impl<N: Network> Serialize for Metadata<N> {
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()
}
Expand All @@ -52,11 +53,11 @@ impl<'de, N: Network> Deserialize<'de> for Metadata<N> {
DeserializeExt::take_from_value::<D>(&mut metadata, "round")?,
DeserializeExt::take_from_value::<D>(&mut metadata, "height")?,
DeserializeExt::take_from_value::<D>(&mut metadata, "total_supply")?,
DeserializeExt::take_from_value::<D>(&mut metadata, "cumulative_proof_target")?,
DeserializeExt::take_from_value::<D>(&mut metadata, "coinbase_target")?,
DeserializeExt::take_from_value::<D>(&mut metadata, "proof_target")?,
DeserializeExt::take_from_value::<D>(&mut metadata, "last_coinbase_target")?,
DeserializeExt::take_from_value::<D>(&mut metadata, "last_coinbase_timestamp")?,
DeserializeExt::take_from_value::<D>(&mut metadata, "cumulative_proof_target")?,
DeserializeExt::take_from_value::<D>(&mut metadata, "timestamp")?,
)
.map_err(de::Error::custom)?)
Expand Down

0 comments on commit 4a245eb

Please sign in to comment.