From 48a882322ccaa78bf3f6576877b5b3a3475b40dd Mon Sep 17 00:00:00 2001 From: Jake Hartnell Date: Mon, 24 Oct 2022 13:56:35 -0700 Subject: [PATCH] Update ci/integration-tests/src/helpers/chain.rs Co-authored-by: Jakub Bogucki --- ci/integration-tests/src/helpers/chain.rs | 27 ++++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/ci/integration-tests/src/helpers/chain.rs b/ci/integration-tests/src/helpers/chain.rs index 52516b634..67ac4ea43 100644 --- a/ci/integration-tests/src/helpers/chain.rs +++ b/ci/integration-tests/src/helpers/chain.rs @@ -61,20 +61,21 @@ fn test_accounts() -> HashMap { let bytes = fs::read("../configs/test_accounts.json").unwrap(); let accounts: Vec = serde_json::from_slice(&bytes).unwrap(); - let mut account_map = HashMap::new(); - for account in accounts { - account_map.insert( - account.name.clone(), - SigningAccount { - account: account.clone(), - key: SigningKey { - name: account.name, - key: Key::Mnemonic(account.mnemonic), + accounts + .into_iter() + .map(|account| { + ( + account.name.clone(), + SigningAccount { + account: account.clone(), + key: SigningKey { + name: account.name, + key: Key::Mnemonic(account.mnemonic), + }, }, - }, - ); - } - account_map + ) + }) + .collect::>() } // global_setup() runs once before all of the tests