Pre-populate the trie with a live account so that subsequent destroy bundles have something to delete (TrieNode::delete errors on a missing key).
(db: &mut TrieDB<NoopTrieDBProvider, NoopTrieHinter>, address: Address)
| 431 | // Pre-populate the trie with a live account so that subsequent destroy bundles have |
| 432 | // something to delete (TrieNode::delete errors on a missing key). |
| 433 | fn insert_account(db: &mut TrieDB<NoopTrieDBProvider, NoopTrieHinter>, address: Address) { |
| 434 | let account = BundleAccount::new( |
| 435 | None, |
| 436 | Some(AccountInfo { balance: U256::from(100u64), ..Default::default() }), |
| 437 | Default::default(), |
| 438 | AccountStatus::InMemoryChange, |
| 439 | ); |
| 440 | db.state_root(&bundle_with_account(address, account)).unwrap(); |
| 441 | } |
| 442 | |
| 443 | // A destroyed account (info = None) that already lived in the parent trie must be |
| 444 | // removed from the state root for every revm status that maps to "account is gone". |