From 9b1729e547786a58fa4906df94829906e9a47305 Mon Sep 17 00:00:00 2001 From: tedison Date: Thu, 7 Nov 2024 10:22:48 -0500 Subject: [PATCH] Add debug trait + format --- crates/dojo/test-utils/src/sequencer.rs | 4 +--- crates/katana/core/src/constants.rs | 2 +- crates/katana/node/src/config/mod.rs | 29 +++++++++++-------------- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/crates/dojo/test-utils/src/sequencer.rs b/crates/dojo/test-utils/src/sequencer.rs index 2e9907adcd..3835f76f53 100644 --- a/crates/dojo/test-utils/src/sequencer.rs +++ b/crates/dojo/test-utils/src/sequencer.rs @@ -5,12 +5,10 @@ use jsonrpsee::core::Error; use katana_core::backend::Backend; use katana_core::constants::DEFAULT_SEQUENCER_ADDRESS; use katana_executor::implementation::blockifier::BlockifierFactory; -use katana_node::config::dev::DevConfig; -use katana_node::config::rpc::{ApiKind, RpcConfig, DEFAULT_RPC_ADDR, DEFAULT_RPC_MAX_CONNECTIONS}; +use katana_node::config::rpc::ApiKind; pub use katana_node::config::*; use katana_node::LaunchedNode; use katana_primitives::chain::ChainId; -use katana_primitives::chain_spec::ChainSpec; use starknet::accounts::{ExecutionEncoding, SingleOwnerAccount}; use starknet::core::chain_id; use starknet::core::types::{BlockId, BlockTag, Felt}; diff --git a/crates/katana/core/src/constants.rs b/crates/katana/core/src/constants.rs index 5bd7847654..99b95ef776 100644 --- a/crates/katana/core/src/constants.rs +++ b/crates/katana/core/src/constants.rs @@ -9,4 +9,4 @@ pub const DEFAULT_STRK_L1_GAS_PRICE: u128 = 100 * u128::pow(10, 9); // Given in pub const DEFAULT_ETH_L1_DATA_GAS_PRICE: u128 = u128::pow(10, 6); // Given in units of Wei. pub const DEFAULT_STRK_L1_DATA_GAS_PRICE: u128 = u128::pow(10, 9); // Given in units of STRK. -pub const DEFAULT_SEQUENCER_ADDRESS: ContractAddress = ContractAddress(felt!("0x1")); \ No newline at end of file +pub const DEFAULT_SEQUENCER_ADDRESS: ContractAddress = ContractAddress(felt!("0x1")); diff --git a/crates/katana/node/src/config/mod.rs b/crates/katana/node/src/config/mod.rs index f144f1cb0d..e36e73555e 100644 --- a/crates/katana/node/src/config/mod.rs +++ b/crates/katana/node/src/config/mod.rs @@ -5,27 +5,24 @@ pub mod fork; pub mod metrics; pub mod rpc; -use std::{ - collections::{BTreeMap, HashSet}, - net::{IpAddr, SocketAddr}, - path::PathBuf, - str::FromStr, -}; +use std::collections::{BTreeMap, HashSet}; +use std::net::{IpAddr, SocketAddr}; +use std::path::PathBuf; +use std::str::FromStr; use db::DbConfig; use dev::{DevConfig, FixedL1GasPriceConfig}; use execution::ExecutionConfig; use fork::ForkingConfig; use katana_core::service::messaging::MessagingConfig; -use katana_primitives::{ - block::{BlockHash, BlockHashOrNumber, BlockNumber, GasPrices}, - chain::ChainId, - chain_spec::ChainSpec, - class::ClassHash, - genesis::{allocation::GenesisAllocation, GenesisClass}, - version::ProtocolVersion, - ContractAddress, Felt, -}; +use katana_primitives::block::{BlockHash, BlockHashOrNumber, BlockNumber, GasPrices}; +use katana_primitives::chain::ChainId; +use katana_primitives::chain_spec::ChainSpec; +use katana_primitives::class::ClassHash; +use katana_primitives::genesis::allocation::GenesisAllocation; +use katana_primitives::genesis::GenesisClass; +use katana_primitives::version::ProtocolVersion; +use katana_primitives::{ContractAddress, Felt}; use metrics::MetricsConfig; use rpc::{ApiKind, RpcConfig}; use starknet::providers::Url; @@ -75,7 +72,7 @@ pub struct SequencingConfig { pub no_mining: bool, } -#[derive(Default)] +#[derive(Default, Debug)] pub struct ConfigBuilder { config: Config, }