Fix block v3 reward encodings (#5049)

* Fix block v3 reward encodings

* Use crates.io version
This commit is contained in:
Michael Sproul
2024-01-10 10:44:07 +11:00
committed by GitHub
parent 4a65d28b3b
commit 7e948eec9d
5 changed files with 13 additions and 8 deletions

View File

@@ -1554,9 +1554,10 @@ pub struct ProduceBlockV3Metadata {
)]
pub consensus_version: ForkName,
pub execution_payload_blinded: bool,
#[serde(with = "serde_utils::u256_dec")]
pub execution_payload_value: Uint256,
#[serde(with = "serde_utils::quoted_u64")]
pub consensus_block_value: u64,
#[serde(with = "serde_utils::u256_dec")]
pub consensus_block_value: Uint256,
}
impl<T: EthSpec> FullBlockContents<T> {
@@ -1707,7 +1708,7 @@ impl TryFrom<&HeaderMap> for ProduceBlockV3Metadata {
})?;
let consensus_block_value =
parse_required_header(headers, CONSENSUS_BLOCK_VALUE_HEADER, |s| {
s.parse::<u64>()
s.parse::<Uint256>()
.map_err(|e| format!("invalid {CONSENSUS_BLOCK_VALUE_HEADER}: {e:?}"))
})?;