From 61ad4b137140ad77a98fbfec2e5464f3289462e1 Mon Sep 17 00:00:00 2001 From: Arni Hod Date: Wed, 13 Nov 2024 15:35:45 +0200 Subject: [PATCH] chore: move nonce manager struct near the impl block --- crates/starknet_api/src/test_utils.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/starknet_api/src/test_utils.rs b/crates/starknet_api/src/test_utils.rs index 276bf291d6..9ca19eb799 100644 --- a/crates/starknet_api/src/test_utils.rs +++ b/crates/starknet_api/src/test_utils.rs @@ -11,11 +11,6 @@ pub mod declare; pub mod deploy_account; pub mod invoke; -#[derive(Debug, Default)] -pub struct NonceManager { - next_nonce: HashMap, -} - /// Reads from the directory containing the manifest at run time, same as current working directory. pub fn read_json_file(path_in_resource_dir: &str) -> serde_json::Value { let path = Path::new(&env::var("CARGO_MANIFEST_DIR").unwrap()) @@ -26,6 +21,11 @@ pub fn read_json_file(path_in_resource_dir: &str) -> serde_json::Value { serde_json::from_str(&json_str).unwrap() } +#[derive(Debug, Default)] +pub struct NonceManager { + next_nonce: HashMap, +} + impl NonceManager { pub fn next(&mut self, account_address: ContractAddress) -> Nonce { let next = self.next_nonce.remove(&account_address).unwrap_or_default();