Merge pull request #3845 from realbigsean/capella-cleanup

Capella cleanup
This commit is contained in:
ethDreamer
2023-01-06 13:26:41 -06:00
committed by GitHub
18 changed files with 109 additions and 302 deletions

View File

@@ -350,12 +350,14 @@ impl From<Withdrawal> for JsonWithdrawal {
impl From<JsonWithdrawal> for Withdrawal {
fn from(jw: JsonWithdrawal) -> Self {
// 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,
validator_index: jw.validator_index,
address: jw.address,
//FIXME(sean) if EE gives us too large a number this panics
amount: (jw.amount / 1000000000).as_u64(),
amount: amount.as_u64(),
}
}
}