Update beacon_node/execution_layer/src/engine_api/json_structures.rs

This commit is contained in:
realbigsean
2023-01-03 08:55:19 -05:00
committed by GitHub
parent d8f7277beb
commit 4353c49855

View File

@@ -350,8 +350,8 @@ impl From<Withdrawal> for JsonWithdrawal {
impl From<JsonWithdrawal> for Withdrawal {
fn from(jw: JsonWithdrawal) -> Self {
// This comparison is to avoid a scenarion where the EE gives us too large a number this
// panics when it attempts to case to a `u64`.
// This comparison is done to avoid a scenario where the EE gives us too large a number and we
// panic when attempting to cast to a `u64`.
let amount = std::cmp::max(jw.amount / 1000000000, Uint256::from(u64::MAX));
Self {
index: jw.index,