From f54fb3e7ab659e3f57f99b534b5277bfeabffd9a Mon Sep 17 00:00:00 2001 From: apoorvsadana <95699312+apoorvsadana@users.noreply.github.com> Date: Mon, 19 Aug 2024 00:45:53 +0530 Subject: [PATCH] cleanup --- .env.test | 1 - crates/settlement-clients/ethereum/src/lib.rs | 5 +---- crates/settlement-clients/ethereum/src/tests/mod.rs | 11 ++--------- crates/settlement-clients/starknet/src/lib.rs | 6 ------ 4 files changed, 3 insertions(+), 20 deletions(-) diff --git a/.env.test b/.env.test index 1dcb7b09..8c4a2678 100644 --- a/.env.test +++ b/.env.test @@ -28,7 +28,6 @@ MONGODB_CONNECTION_STRING="mongodb://localhost:27017" # Ethereum Settlement -DEFAULT_SETTLEMENT_CLIENT_RPC="http://localhost:8545" DEFAULT_L1_CORE_CONTRACT_ADDRESS="0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4" SHOULD_IMPERSONATE_ACCOUNT="true" TEST_DUMMY_CONTRACT_ADDRESS="0xE5b6F5e695BA6E4aeD92B68c4CC8Df1160D69A81" \ No newline at end of file diff --git a/crates/settlement-clients/ethereum/src/lib.rs b/crates/settlement-clients/ethereum/src/lib.rs index 598e9902..036250f5 100644 --- a/crates/settlement-clients/ethereum/src/lib.rs +++ b/crates/settlement-clients/ethereum/src/lib.rs @@ -13,12 +13,9 @@ use alloy::{ signers::local::PrivateKeySigner, }; -// use eyre::Result; use alloy::eips::eip2930::AccessList; use alloy::eips::eip4844::BYTES_PER_BLOB; use alloy::hex; -use alloy::providers::ext::AnvilApi; -// use alloy::node_bindings::Anvil; use alloy::rpc::types::TransactionRequest; use alloy_primitives::Bytes; use async_trait::async_trait; @@ -30,6 +27,7 @@ use mockall::{automock, lazy_static, predicate::*}; use alloy::providers::ProviderBuilder; use conversion::{get_input_data_for_eip_4844, prepare_sidecar}; use settlement_client_interface::{SettlementClient, SettlementVerificationStatus, SETTLEMENT_SETTINGS_NAME}; +#[cfg(test)] use url::Url; use utils::{env_utils::get_env_var_or_panic, settings::SettingsProvider}; @@ -297,7 +295,6 @@ impl SettlementClient for EthereumSettlementClient { mod test_config { use super::*; use alloy::network::TransactionBuilder; - use tests::STARKNET_OPERATOR_ADDRESS; pub async fn configure_transaction( provider: Arc>>, diff --git a/crates/settlement-clients/ethereum/src/tests/mod.rs b/crates/settlement-clients/ethereum/src/tests/mod.rs index a99e7115..117c9c4e 100644 --- a/crates/settlement-clients/ethereum/src/tests/mod.rs +++ b/crates/settlement-clients/ethereum/src/tests/mod.rs @@ -20,7 +20,6 @@ use tokio::time::sleep; use utils::env_utils::get_env_var_or_panic; use settlement_client_interface::SettlementClient; -use utils::settings::default::DefaultSettingsProvider; use crate::conversion::to_padded_hex; use crate::EthereumSettlementClient; @@ -74,19 +73,13 @@ sol! { } } -pub struct TestSetup { - pub anvil: AnvilInstance, - pub ethereum_settlement_client: EthereumSettlementClient, - pub provider: alloy::providers::RootProvider>, -} - struct EthereumTestBuilder { fork_block: Option, impersonator: Option
, } struct EthereumTest { - anvil: AnvilInstance, + _anvil: AnvilInstance, provider: alloy::providers::RootProvider>, rpc_url: Url, } @@ -127,7 +120,7 @@ impl EthereumTestBuilder { let rpc_url = anvil.endpoint_url(); - EthereumTest { anvil, provider, rpc_url } + EthereumTest { _anvil: anvil, provider, rpc_url } } } diff --git a/crates/settlement-clients/starknet/src/lib.rs b/crates/settlement-clients/starknet/src/lib.rs index e40c2927..0730309e 100644 --- a/crates/settlement-clients/starknet/src/lib.rs +++ b/crates/settlement-clients/starknet/src/lib.rs @@ -127,12 +127,6 @@ impl SettlementClient for StarknetSettlementClient { Ok(format!("0x{:x}", invoke_result.transaction_hash)) } - /// Should be used to update state on core contract when DA is in blobs/alt DA - #[allow(unused)] - async fn update_state_blobs(&self, program_output: Vec<[u8; 32]>, kzg_proof: [u8; 48]) -> Result { - !unimplemented!("not available for starknet settlement layer") - } - /// Should verify the inclusion of a tx in the settlement layer async fn verify_tx_inclusion(&self, tx_hash: &str) -> Result { let tx_hash = FieldElement::from_hex_be(tx_hash)?;