Fix block v3 header decoding (#5366)

* Fix block v3 header decoding
This commit is contained in:
Michael Sproul
2024-03-07 14:31:06 +11:00
committed by GitHub
parent 258eeb5f09
commit bf118a17d4
2 changed files with 69 additions and 23 deletions

View File

@@ -1710,12 +1710,12 @@ impl TryFrom<&HeaderMap> for ProduceBlockV3Metadata {
})?;
let execution_payload_value =
parse_required_header(headers, EXECUTION_PAYLOAD_VALUE_HEADER, |s| {
s.parse::<Uint256>()
Uint256::from_dec_str(s)
.map_err(|e| format!("invalid {EXECUTION_PAYLOAD_VALUE_HEADER}: {e:?}"))
})?;
let consensus_block_value =
parse_required_header(headers, CONSENSUS_BLOCK_VALUE_HEADER, |s| {
s.parse::<Uint256>()
Uint256::from_dec_str(s)
.map_err(|e| format!("invalid {CONSENSUS_BLOCK_VALUE_HEADER}: {e:?}"))
})?;