From 81feee9c9501ee67bd661b539605e076876ee0d1 Mon Sep 17 00:00:00 2001 From: Itay Tsabary Date: Tue, 14 Jan 2025 15:07:03 +0200 Subject: [PATCH] chore(starknet_integration_tests): delete deprecated fns commit-id:d9a2ae58 --- Cargo.lock | 3 -- crates/starknet_integration_tests/Cargo.toml | 3 -- .../src/state_reader.rs | 46 +------------------ 3 files changed, 2 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef5fea3552..6598bbc812 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10946,14 +10946,12 @@ dependencies = [ "indexmap 2.7.0", "itertools 0.12.1", "mempool_test_utils", - "papyrus_common", "papyrus_config", "papyrus_consensus", "papyrus_consensus_orchestrator", "papyrus_execution", "papyrus_network", "papyrus_protobuf", - "papyrus_rpc", "papyrus_storage", "pretty_assertions", "rstest", @@ -10961,7 +10959,6 @@ dependencies = [ "starknet-types-core", "starknet_api", "starknet_batcher", - "starknet_client", "starknet_consensus_manager", "starknet_gateway", "starknet_gateway_types", diff --git a/crates/starknet_integration_tests/Cargo.toml b/crates/starknet_integration_tests/Cargo.toml index b8d2a5d537..b512add95f 100644 --- a/crates/starknet_integration_tests/Cargo.toml +++ b/crates/starknet_integration_tests/Cargo.toml @@ -17,20 +17,17 @@ futures.workspace = true indexmap.workspace = true itertools.workspace = true mempool_test_utils.workspace = true -papyrus_common.workspace = true papyrus_config.workspace = true papyrus_consensus.workspace = true papyrus_consensus_orchestrator.workspace = true papyrus_execution.workspace = true papyrus_network = { workspace = true, features = ["testing"] } papyrus_protobuf.workspace = true -papyrus_rpc.workspace = true papyrus_storage = { workspace = true, features = ["testing"] } serde_json.workspace = true starknet-types-core.workspace = true starknet_api.workspace = true starknet_batcher.workspace = true -starknet_client.workspace = true starknet_consensus_manager.workspace = true starknet_gateway = { workspace = true, features = ["testing"] } starknet_gateway_types.workspace = true diff --git a/crates/starknet_integration_tests/src/state_reader.rs b/crates/starknet_integration_tests/src/state_reader.rs index 7add790e68..8dd947743d 100644 --- a/crates/starknet_integration_tests/src/state_reader.rs +++ b/crates/starknet_integration_tests/src/state_reader.rs @@ -1,6 +1,4 @@ use std::collections::HashMap; -use std::net::SocketAddr; -use std::sync::Arc; use assert_matches::assert_matches; use blockifier::context::ChainInfo; @@ -11,15 +9,13 @@ use cairo_lang_starknet_classes::casm_contract_class::CasmContractClass; use indexmap::IndexMap; use itertools::Itertools; use mempool_test_utils::starknet_api_test_utils::{AccountTransactionGenerator, Contract}; -use papyrus_common::pending_classes::PendingClasses; -use papyrus_rpc::{run_server, RpcConfig}; use papyrus_storage::body::BodyStorageWriter; use papyrus_storage::class::ClassStorageWriter; use papyrus_storage::compiled_class::CasmStorageWriter; use papyrus_storage::header::HeaderStorageWriter; use papyrus_storage::state::StateStorageWriter; use papyrus_storage::test_utils::TestStorageBuilder; -use papyrus_storage::{StorageConfig, StorageReader, StorageScope, StorageWriter}; +use papyrus_storage::{StorageConfig, StorageScope, StorageWriter}; use starknet_api::abi::abi_utils::get_fee_token_var_address; use starknet_api::block::{ BlockBody, @@ -30,7 +26,7 @@ use starknet_api::block::{ FeeType, GasPricePerToken, }; -use starknet_api::core::{ChainId, ClassHash, ContractAddress, Nonce, SequencerContractAddress}; +use starknet_api::core::{ClassHash, ContractAddress, Nonce, SequencerContractAddress}; use starknet_api::deprecated_contract_class::ContractClass as DeprecatedContractClass; use starknet_api::state::{SierraContractClass, StorageKey, ThinStateDiff}; use starknet_api::test_utils::{ @@ -41,12 +37,9 @@ use starknet_api::test_utils::{ }; use starknet_api::transaction::fields::Fee; use starknet_api::{contract_address, felt}; -use starknet_client::reader::PendingData; -use starknet_sequencer_infra::test_utils::get_available_socket; use starknet_types_core::felt::Felt; use strum::IntoEnumIterator; use tempfile::TempDir; -use tokio::sync::RwLock; type ContractClassesMap = (Vec<(ClassHash, DeprecatedContractClass)>, Vec<(ClassHash, CasmContractClass)>); @@ -287,41 +280,6 @@ fn test_block_header(block_number: BlockNumber) -> BlockHeader { } } -/// Spawns a papyrus rpc server for given state reader and chain id. -/// Returns the address of the rpc server. -pub async fn spawn_test_rpc_state_reader( - storage_reader: StorageReader, - chain_id: ChainId, -) -> SocketAddr { - let socket = get_available_socket().await; - spawn_test_rpc_state_reader_with_socket(storage_reader, chain_id, socket).await; - socket -} - -/// Spawns a papyrus rpc server for given state reader, chain id, and socket address. -pub async fn spawn_test_rpc_state_reader_with_socket( - storage_reader: StorageReader, - chain_id: ChainId, - socket: SocketAddr, -) -> SocketAddr { - let rpc_config = - RpcConfig { chain_id, server_address: socket.to_string(), ..Default::default() }; - let (addr, handle) = run_server( - &rpc_config, - Arc::new(RwLock::new(None)), - Arc::new(RwLock::new(PendingData::default())), - Arc::new(RwLock::new(PendingClasses::default())), - storage_reader, - "NODE VERSION", - ) - .await - .unwrap(); - // Spawn the server handle to keep the server running, otherwise the server will stop once the - // handler is out of scope. - tokio::spawn(handle.stopped()); - addr -} - /// Constructs a thin state diff from lists of contracts, where each contract can be declared, /// deployed, and in case it is an account, funded. #[derive(Default)]