From 7456a9c1ce3e6001cc893430b08bc4e278476efa Mon Sep 17 00:00:00 2001 From: ICavlek Date: Thu, 3 Oct 2024 09:47:59 +0200 Subject: [PATCH] refactor: removed unnecessary test --- tests/common/ctx.rs | 2 +- tests/rpc.rs | 50 --------------------------------------------- 2 files changed, 1 insertion(+), 51 deletions(-) diff --git a/tests/common/ctx.rs b/tests/common/ctx.rs index 5e773eee..2e840687 100644 --- a/tests/common/ctx.rs +++ b/tests/common/ctx.rs @@ -77,7 +77,7 @@ macro_rules! setup { let context = match $e { "sepolia" => common::ctx::ctx_sepolia().await, "mainnet" => common::ctx::ctx_mainnet().await, - _ => panic!("Invalid network setup. Has to be mainnet or sepolia."), + unknown => panic!("Unknown network: {unknown}. Supported networks: mainnet, sepolia"), }; if let Some(ctx) = context { ctx diff --git a/tests/rpc.rs b/tests/rpc.rs index 058f86a8..8fc9ecf7 100644 --- a/tests/rpc.rs +++ b/tests/rpc.rs @@ -444,53 +444,3 @@ async fn test_getClassHashAt() -> Result<(), Error> { ); Ok(()) } - -#[tokio::test] -async fn test_declare_deploy_account_already_existing() -> Result<(), Error> { - let ctx = setup!("sepolia"); - - let res_chain_id = ctx.client.chainId().await?; - assert_eq!(res_chain_id.as_ref(), SEPOLIA_STARKNET_CHAINID); - - let res_spec_version = ctx.client.specVersion().await?; - assert_eq!(res_spec_version, "0.7.1"); - - let block_id = BlockId::BlockTag(BlockTag::Latest); - let class_hash = Felt::try_new(CLASS_HASH)?; - let res_class = ctx.client.getClass(block_id, class_hash.clone()).await; - assert!(res_class.is_ok()); - - let declare_account: BroadcastedDeclareTxn = - serde_json::from_str(DECLARE_ACCOUNT_V3)?; - let res_declare = ctx.client.addDeclareTransaction(declare_account).await; - assert!(res_declare.is_err()); - assert!(res_declare - .unwrap_err() - .message - .contains("Account validation failed")); - - let deploy_account = BroadcastedDeployAccountTxn(DeployAccountTxn::DeployAccountTxnV1(DeployAccountTxnV1{ - class_hash, - constructor_calldata: vec![ - Felt::try_new("0x7e48300f2857fb5f0d5b59b837eedbd8c82dba528546750cb5c5324e02d8744")?, - ], - contract_address_salt: Felt::try_new("0x70e3421d58127670aed1e27218b84aab8a2424345e30125df0cb29d04057bae")?, - max_fee: Felt::try_new("0x1c484e3020c00")?, - nonce: Felt::try_new("0x0")?, - r#type: DeployAccountTxnV1Type::DeployAccount, - signature: vec![ - Felt::try_new("0x239f9a3dad69270f669a0796250c03afd5332aa0c07bd5f302169833f3459a3")?, - Felt::try_new("0x43c6d5ddc2bf6f0581dbe39d1dfb2335d1ae090173f1a0c9ff4f5210057e45d")? - ], - version: DeployAccountTxnV1Version::V0x1, - })); - let res_deploy = - ctx.client.addDeployAccountTransaction(deploy_account).await; - assert!(res_deploy.is_err()); - assert!(res_deploy - .unwrap_err() - .message - .contains("Account validation failed")); - - Ok(()) -}