diff --git a/runtime/src/accounts_hash.rs b/runtime/src/accounts_hash.rs index 875d4a58a0..f497f2658b 100644 --- a/runtime/src/accounts_hash.rs +++ b/runtime/src/accounts_hash.rs @@ -706,9 +706,12 @@ impl AccountsHasher { } pub fn checked_cast_for_capitalization(balance: u128) -> u64 { - balance - .try_into() - .expect("overflow is detected while summing capitalization") + balance.try_into().unwrap_or_else(|_| { + panic!( + "overflow is detected while summing capitalization: {}", + balance + ) + }) } /// return references to cache hash data, grouped by bin, sourced from 'sorted_data_by_pubkey',