From 9de5e75d14a29599aa0fd3552ca2621842d4b016 Mon Sep 17 00:00:00 2001 From: Fred Tupas Date: Fri, 15 Sep 2023 09:00:17 +0700 Subject: [PATCH] dev: remove redundant ContractNotFound --- crates/core/src/client/mod.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/crates/core/src/client/mod.rs b/crates/core/src/client/mod.rs index 758f2ca3b..193df0a0a 100644 --- a/crates/core/src/client/mod.rs +++ b/crates/core/src/client/mod.rs @@ -359,20 +359,8 @@ impl KakarotEthApi

for KakarotClient

contract_account.nonce(&starknet_block_id).await } else { // Get the nonce of the EOA - self.starknet_provider - .get_nonce(starknet_block_id, starknet_address) - .await - .map(|nonce| { - let nonce: Felt252Wrapper = nonce.into(); - nonce.into() - }) - .or_else(|err| match err { - ProviderError::StarknetError(StarknetErrorWithMessage { - code: MaybeUnknownErrorCode::Known(StarknetError::ContractNotFound), - .. - }) => Ok(U256::from(0)), - _ => Err(EthApiError::from(err)), - }) + let nonce = self.starknet_provider.get_nonce(starknet_block_id, starknet_address).await?; + Ok(Felt252Wrapper::from(nonce).into()) } }