From b096f94a5c0bd33c5d18aa1962ed864b04392333 Mon Sep 17 00:00:00 2001 From: Daniyar Itegulov Date: Wed, 18 Dec 2024 16:04:04 +1100 Subject: [PATCH] move `transaction_order` to the types crate --- crates/cli/src/cli.rs | 6 ++++-- crates/config/src/config.rs | 4 +++- crates/core/src/node/in_memory.rs | 7 +++++-- crates/core/src/node/in_memory_ext.rs | 2 +- crates/core/src/node/pool.rs | 4 ++-- crates/core/src/node/sealer.rs | 2 +- crates/types/src/lib.rs | 2 ++ .../{config/src/types => types/src}/transaction_order.rs | 0 8 files changed, 18 insertions(+), 9 deletions(-) rename crates/{config/src/types => types/src}/transaction_order.rs (100%) diff --git a/crates/cli/src/cli.rs b/crates/cli/src/cli.rs index f62e6dd5..c4847ecd 100644 --- a/crates/cli/src/cli.rs +++ b/crates/cli/src/cli.rs @@ -6,8 +6,10 @@ use anvil_zksync_config::constants::{ use anvil_zksync_config::types::{ AccountGenerator, CacheConfig, CacheType, Genesis, SystemContractsOptions, }; -use anvil_zksync_config::{types::TransactionOrder, TestNodeConfig}; -use anvil_zksync_types::{LogLevel, ShowCalls, ShowGasDetails, ShowStorageLogs, ShowVMDetails}; +use anvil_zksync_config::TestNodeConfig; +use anvil_zksync_types::{ + LogLevel, ShowCalls, ShowGasDetails, ShowStorageLogs, ShowVMDetails, TransactionOrder, +}; use clap::{arg, command, Parser, Subcommand}; use rand::{rngs::StdRng, SeedableRng}; use std::env; diff --git a/crates/config/src/config.rs b/crates/config/src/config.rs index eb3d1498..6e139a3e 100644 --- a/crates/config/src/config.rs +++ b/crates/config/src/config.rs @@ -2,7 +2,9 @@ use crate::constants::*; use crate::types::*; use crate::utils::{format_eth, format_gwei}; use alloy_signer_local::PrivateKeySigner; -use anvil_zksync_types::{LogLevel, ShowCalls, ShowGasDetails, ShowStorageLogs, ShowVMDetails}; +use anvil_zksync_types::{ + LogLevel, ShowCalls, ShowGasDetails, ShowStorageLogs, ShowVMDetails, TransactionOrder, +}; use colored::{Colorize, CustomColor}; use serde_json::{json, to_writer, Value}; use std::collections::HashMap; diff --git a/crates/core/src/node/in_memory.rs b/crates/core/src/node/in_memory.rs index 085d800b..cc346fed 100644 --- a/crates/core/src/node/in_memory.rs +++ b/crates/core/src/node/in_memory.rs @@ -25,7 +25,9 @@ use anvil_zksync_config::constants::{ }; use anvil_zksync_config::types::{CacheConfig, Genesis, SystemContractsOptions}; use anvil_zksync_config::TestNodeConfig; -use anvil_zksync_types::{LogLevel, ShowCalls, ShowGasDetails, ShowStorageLogs, ShowVMDetails}; +use anvil_zksync_types::{ + LogLevel, ShowCalls, ShowGasDetails, ShowStorageLogs, ShowVMDetails, TransactionOrder, +}; use colored::Colorize; use flate2::read::GzDecoder; use flate2::write::GzEncoder; @@ -2122,8 +2124,9 @@ mod tests { DEFAULT_ESTIMATE_GAS_SCALE_FACTOR, DEFAULT_FAIR_PUBDATA_PRICE, DEFAULT_L2_GAS_PRICE, TEST_NODE_NETWORK_ID, }; - use anvil_zksync_config::types::{SystemContractsOptions, TransactionOrder}; + use anvil_zksync_config::types::SystemContractsOptions; use anvil_zksync_config::TestNodeConfig; + use anvil_zksync_types::TransactionOrder; use ethabi::{Token, Uint}; use zksync_types::{utils::deployed_address_create, K256PrivateKey, Nonce}; diff --git a/crates/core/src/node/in_memory_ext.rs b/crates/core/src/node/in_memory_ext.rs index b4008d41..21696c84 100644 --- a/crates/core/src/node/in_memory_ext.rs +++ b/crates/core/src/node/in_memory_ext.rs @@ -498,7 +498,7 @@ mod tests { use crate::node::time::{ReadTime, TimestampManager}; use crate::node::InMemoryNode; use crate::node::{BlockSealer, ImpersonationManager, InMemoryNodeInner, Snapshot, TxPool}; - use anvil_zksync_config::types::TransactionOrder; + use anvil_zksync_types::TransactionOrder; use std::str::FromStr; use std::sync::{Arc, RwLock}; use zksync_multivm::interface::storage::ReadStorage; diff --git a/crates/core/src/node/pool.rs b/crates/core/src/node/pool.rs index 5affc8d5..c7ca7f26 100644 --- a/crates/core/src/node/pool.rs +++ b/crates/core/src/node/pool.rs @@ -1,5 +1,5 @@ use crate::node::impersonate::ImpersonationManager; -use anvil_zksync_config::types::{TransactionOrder, TransactionPriority}; +use anvil_zksync_types::{TransactionOrder, TransactionPriority}; use futures::channel::mpsc::{channel, Receiver, Sender}; use std::cmp::Ordering; use std::collections::BTreeSet; @@ -245,7 +245,7 @@ mod tests { use crate::node::pool::TxBatch; use crate::node::{ImpersonationManager, TxPool}; use crate::testing; - use anvil_zksync_config::types::TransactionOrder; + use anvil_zksync_types::TransactionOrder; use test_case::test_case; use zksync_types::{l2::L2Tx, U256}; diff --git a/crates/core/src/node/sealer.rs b/crates/core/src/node/sealer.rs index 8e9b4c92..589c5ede 100644 --- a/crates/core/src/node/sealer.rs +++ b/crates/core/src/node/sealer.rs @@ -154,7 +154,7 @@ mod tests { use crate::node::pool::TxBatch; use crate::node::sealer::BlockSealerMode; use crate::node::{BlockSealer, ImpersonationManager, TxPool}; - use anvil_zksync_config::types::TransactionOrder; + use anvil_zksync_types::TransactionOrder; use std::ptr; use std::task::{Context, Poll, RawWaker, RawWakerVTable, Waker}; use std::time::Duration; diff --git a/crates/types/src/lib.rs b/crates/types/src/lib.rs index 4d05b43c..4fd0fe9d 100644 --- a/crates/types/src/lib.rs +++ b/crates/types/src/lib.rs @@ -2,9 +2,11 @@ pub mod api; mod log; mod serde_helpers; mod show_details; +mod transaction_order; pub use self::{ log::LogLevel, serde_helpers::Numeric, show_details::{ShowCalls, ShowGasDetails, ShowStorageLogs, ShowVMDetails}, + transaction_order::{TransactionOrder, TransactionPriority}, }; diff --git a/crates/config/src/types/transaction_order.rs b/crates/types/src/transaction_order.rs similarity index 100% rename from crates/config/src/types/transaction_order.rs rename to crates/types/src/transaction_order.rs