fix: always serialize zero balance (#4929)

This commit is contained in:
Matthias Seitz
2023-10-06 16:58:12 +02:00
committed by GitHub
parent 50fa71d8d8
commit 529635f8d4

View File

@ -78,7 +78,7 @@ impl AccountState {
/// If code is empty, it will be omitted.
pub fn from_account_info(nonce: u64, balance: U256, code: Option<Bytes>) -> Self {
Self {
balance: (balance != U256::ZERO).then_some(balance),
balance: Some(balance),
code: code.filter(|code| !code.is_empty()),
nonce: (nonce != 0).then_some(nonce),
storage: Default::default(),