diff --git a/crates/interfaces/src/test_utils/generators.rs b/crates/interfaces/src/test_utils/generators.rs index b3cd847b2..e601d9629 100644 --- a/crates/interfaces/src/test_utils/generators.rs +++ b/crates/interfaces/src/test_utils/generators.rs @@ -196,7 +196,6 @@ pub type ChangeSet = Vec<(Address, Account, Vec)>; type AccountState = (Account, Vec); /// Generate a range of changesets for given blocks and accounts. -/// Assumes all accounts start with an empty storage. /// /// Returns a Vec of account and storage changes for each block, /// along with the final state of all accounts and storages. @@ -216,7 +215,7 @@ where .map(|(addr, (acc, st))| (addr, (acc, st.into_iter().map(|e| (e.key, e.value)).collect()))) .collect(); - let valid_addresses = state.keys().copied().collect(); + let valid_addresses = state.keys().copied().collect::>(); let mut changesets = Vec::new(); @@ -279,7 +278,7 @@ where /// Returns two addresses, a balance_change, and a Vec of new storage entries. pub fn random_account_change( rng: &mut R, - valid_addresses: &Vec
, + valid_addresses: &[Address], n_storage_changes: Range, key_range: Range, ) -> (Address, Address, U256, Vec) { @@ -340,6 +339,7 @@ pub fn random_contract_account_range( let mut accounts = Vec::with_capacity(acc_range.end.saturating_sub(acc_range.start) as usize); for _ in acc_range { let (address, eoa_account) = random_eoa_account(rng); + // todo: can a non-eoa account have a nonce > 0? let account = Account { bytecode_hash: Some(rng.gen()), ..eoa_account }; accounts.push((address, account)) }