Skip to content

Commit

Permalink
dev: remove redundant ContractNotFound
Browse files Browse the repository at this point in the history
  • Loading branch information
ftupas committed Sep 15, 2023
1 parent 0bf88f1 commit 9de5e75
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions crates/core/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,20 +359,8 @@ impl<P: Provider + Send + Sync + 'static> KakarotEthApi<P> for KakarotClient<P>
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())
}
}

Expand Down

0 comments on commit 9de5e75

Please sign in to comment.