diff --git a/bin/sozo/src/args.rs b/bin/sozo/src/args.rs index 928bc8a4b1..d190da8fb9 100644 --- a/bin/sozo/src/args.rs +++ b/bin/sozo/src/args.rs @@ -12,7 +12,7 @@ use tracing_subscriber::{fmt, EnvFilter}; use crate::commands::Commands; use crate::utils::generate_version; -#[derive(Parser)] +#[derive(Parser, Debug)] #[command(author, version=generate_version(), about, long_about = None)] #[command(propagate_version = true)] pub struct SozoArgs { diff --git a/bin/sozo/src/commands/options/account/controller.rs b/bin/sozo/src/commands/options/account/controller.rs index cc2b385ba4..d863a39829 100644 --- a/bin/sozo/src/commands/options/account/controller.rs +++ b/bin/sozo/src/commands/options/account/controller.rs @@ -21,6 +21,8 @@ use url::Url; use super::WorldAddressOrName; +// This type comes from account_sdk, which doesn't derive Debug. +#[allow(missing_debug_implementations)] pub type ControllerSessionAccount

= SessionAccount; /// Create a new Catridge Controller account based on session key. diff --git a/bin/sozo/src/commands/options/account/type.rs b/bin/sozo/src/commands/options/account/type.rs index a0fda6fbc0..5e3eb4319c 100644 --- a/bin/sozo/src/commands/options/account/type.rs +++ b/bin/sozo/src/commands/options/account/type.rs @@ -31,6 +31,7 @@ pub enum SozoAccountSignError { #[must_use] #[non_exhaustive] #[derive(derive_more::From)] +#[allow(missing_debug_implementations)] pub enum SozoAccount

where P: Send, diff --git a/crates/benches/src/helpers.rs b/crates/benches/src/helpers.rs index 29ffd444a1..3e5e3bc950 100644 --- a/crates/benches/src/helpers.rs +++ b/crates/benches/src/helpers.rs @@ -11,7 +11,7 @@ use starknet::signers::LocalWallet; use tokio::sync::OnceCell; pub type OwnerAccount = SingleOwnerAccount, LocalWallet>; -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct BenchCall(pub &'static str, pub Vec); // Because no calls are actually executed in the benchmark, we can use the same nonce for all of diff --git a/crates/dojo-bindgen/src/plugins/unity/mod.rs b/crates/dojo-bindgen/src/plugins/unity/mod.rs index f83fa84b50..2bdc954040 100644 --- a/crates/dojo-bindgen/src/plugins/unity/mod.rs +++ b/crates/dojo-bindgen/src/plugins/unity/mod.rs @@ -9,6 +9,7 @@ use crate::error::BindgenResult; use crate::plugins::BuiltinPlugin; use crate::{DojoContract, DojoData, DojoModel}; +#[derive(Debug)] pub struct UnityPlugin {} impl UnityPlugin { diff --git a/crates/dojo-lang/src/compiler.rs b/crates/dojo-lang/src/compiler.rs index 54e4f631b6..faa07c22fa 100644 --- a/crates/dojo-lang/src/compiler.rs +++ b/crates/dojo-lang/src/compiler.rs @@ -51,6 +51,7 @@ pub(crate) const LOG_TARGET: &str = "dojo_lang::compiler"; #[path = "compiler_test.rs"] mod test; +#[derive(Debug)] pub struct DojoCompiler; #[derive(Debug, Default, Serialize, Deserialize)] diff --git a/crates/dojo-lang/src/contract.rs b/crates/dojo-lang/src/contract.rs index fb6f787c39..7a9dd4c122 100644 --- a/crates/dojo-lang/src/contract.rs +++ b/crates/dojo-lang/src/contract.rs @@ -23,11 +23,12 @@ use crate::utils::is_name_valid; const DOJO_INIT_FN: &str = "dojo_init"; const CONTRACT_NAMESPACE: &str = "namespace"; -#[derive(Clone, Default)] +#[derive(Debug, Clone, Default)] pub struct ContractParameters { namespace: Option, } +#[derive(Debug)] pub struct DojoContract { diagnostics: Vec, dependencies: HashMap, diff --git a/crates/dojo-lang/src/inline_macros/utils.rs b/crates/dojo-lang/src/inline_macros/utils.rs index 46d23e7280..b0dde78018 100644 --- a/crates/dojo-lang/src/inline_macros/utils.rs +++ b/crates/dojo-lang/src/inline_macros/utils.rs @@ -12,6 +12,7 @@ lazy_static::lazy_static! { pub static ref SYSTEM_READS: Mutex>> = Default::default(); } +#[derive(Debug)] pub enum SystemRWOpRecord { StructCtor(ExprStructCtorCall), Path(ExprPath), diff --git a/crates/dojo-lang/src/interface.rs b/crates/dojo-lang/src/interface.rs index b601ada9d3..bc30581ddf 100644 --- a/crates/dojo-lang/src/interface.rs +++ b/crates/dojo-lang/src/interface.rs @@ -8,6 +8,7 @@ use cairo_lang_utils::unordered_hash_map::UnorderedHashMap; use crate::syntax::self_param; use crate::syntax::world_param::{self, WorldParamInjectionKind}; +#[derive(Debug)] pub struct DojoInterface { diagnostics: Vec, } diff --git a/crates/dojo-lang/src/introspect/utils.rs b/crates/dojo-lang/src/introspect/utils.rs index bf7be9964c..7e2a2acc5f 100644 --- a/crates/dojo-lang/src/introspect/utils.rs +++ b/crates/dojo-lang/src/introspect/utils.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -#[derive(Clone, Default)] +#[derive(Clone, Default, Debug)] pub struct TypeIntrospection(pub usize, pub Vec); // Provides type introspection information for primitive types diff --git a/crates/dojo-lang/src/plugin.rs b/crates/dojo-lang/src/plugin.rs index fd6b46491c..2e619464e4 100644 --- a/crates/dojo-lang/src/plugin.rs +++ b/crates/dojo-lang/src/plugin.rs @@ -555,6 +555,7 @@ impl MacroPlugin for BuiltinDojoPlugin { } } +#[derive(Debug)] pub struct CairoPluginRepository(scarb::compiler::plugin::CairoPluginRepository); impl Default for CairoPluginRepository { diff --git a/crates/dojo-lang/src/plugin_test.rs b/crates/dojo-lang/src/plugin_test.rs index 899cd8557c..ca266f465a 100644 --- a/crates/dojo-lang/src/plugin_test.rs +++ b/crates/dojo-lang/src/plugin_test.rs @@ -39,6 +39,7 @@ pub fn test_expand_plugin( } #[salsa::database(DefsDatabase, ParserDatabase, SyntaxDatabase, FilesDatabase)] +#[allow(missing_debug_implementations)] pub struct DatabaseForTesting { storage: salsa::Storage, } diff --git a/crates/dojo-lang/src/semantics/test_utils.rs b/crates/dojo-lang/src/semantics/test_utils.rs index 00e34b9b9b..e497417f55 100644 --- a/crates/dojo-lang/src/semantics/test_utils.rs +++ b/crates/dojo-lang/src/semantics/test_utils.rs @@ -28,6 +28,7 @@ use once_cell::sync::Lazy; use crate::plugin::dojo_plugin_suite; #[salsa::database(SemanticDatabase, DefsDatabase, ParserDatabase, SyntaxDatabase, FilesDatabase)] +#[allow(missing_debug_implementations)] pub struct DojoSemanticDatabase { storage: salsa::Storage, } @@ -106,6 +107,7 @@ impl Upcast for DojoSemanticDatabase { } } +#[derive(Debug)] pub struct WithStringDiagnostics { value: T, diagnostics: String, @@ -129,6 +131,7 @@ impl WithStringDiagnostics { } /// Helper struct for the return value of [setup_test_module]. +#[derive(Debug)] pub struct TestModule { pub crate_id: CrateId, pub module_id: ModuleId, @@ -172,6 +175,7 @@ pub fn setup_test_module( } /// Helper struct for the return value of [setup_test_function]. +#[derive(Debug)] pub struct TestFunction { pub module_id: ModuleId, pub function_id: FunctionWithBodyId, @@ -219,6 +223,7 @@ pub fn setup_test_function( } /// Helper struct for the return value of [setup_test_expr] and [setup_test_block]. +#[derive(Debug)] pub struct TestExpr { pub module_id: ModuleId, pub function_id: FunctionWithBodyId, diff --git a/crates/dojo-test-utils/src/rpc.rs b/crates/dojo-test-utils/src/rpc.rs index c18a335c17..b3c84865f9 100644 --- a/crates/dojo-test-utils/src/rpc.rs +++ b/crates/dojo-test-utils/src/rpc.rs @@ -8,6 +8,7 @@ use serde_json::Value; use starknet::providers::jsonrpc::{JsonRpcMethod, JsonRpcResponse, JsonRpcTransport}; use thiserror::Error; +#[derive(Debug)] pub struct MockJsonRpcTransport { responses: HashMap<(String, String), String>, } diff --git a/crates/dojo-test-utils/src/sequencer.rs b/crates/dojo-test-utils/src/sequencer.rs index 0e2307d5fe..d3225ac6b1 100644 --- a/crates/dojo-test-utils/src/sequencer.rs +++ b/crates/dojo-test-utils/src/sequencer.rs @@ -21,12 +21,14 @@ use starknet::providers::JsonRpcClient; use starknet::signers::{LocalWallet, SigningKey}; use url::Url; +#[derive(Debug)] pub struct TestAccount { pub private_key: Felt, pub account_address: Felt, } #[allow(unused)] +#[allow(missing_debug_implementations)] pub struct TestSequencer { url: Url, handle: NodeHandle, diff --git a/crates/dojo-types/src/schema.rs b/crates/dojo-types/src/schema.rs index a9a15b5969..6556264f15 100644 --- a/crates/dojo-types/src/schema.rs +++ b/crates/dojo-types/src/schema.rs @@ -223,6 +223,7 @@ impl Ty { } } +#[derive(Debug)] pub struct TyIter<'a> { stack: Vec<&'a Ty>, } diff --git a/crates/dojo-world/src/contracts/model.rs b/crates/dojo-world/src/contracts/model.rs index 6c0742e848..de38198885 100644 --- a/crates/dojo-world/src/contracts/model.rs +++ b/crates/dojo-world/src/contracts/model.rs @@ -66,6 +66,7 @@ pub trait ModelReader { async fn layout(&self) -> Result; } +#[derive(Debug)] pub struct ModelRPCReader<'a, P: Provider + Sync + Send> { /// Namespace of the model namespace: String, diff --git a/crates/dojo-world/src/utils.rs b/crates/dojo-world/src/utils.rs index 4fd2c47800..a18798894c 100644 --- a/crates/dojo-world/src/utils.rs +++ b/crates/dojo-world/src/utils.rs @@ -59,6 +59,7 @@ pub enum TransactionWaitingError { /// let receipt = TransactionWaiter::new(tx_hash, &provider).with_tx_status(TransactionFinalityStatus::AcceptedOnL2).await.unwrap(); /// ``` #[must_use = "TransactionWaiter does nothing unless polled"] +#[allow(missing_debug_implementations)] pub struct TransactionWaiter<'a, P: Provider> { /// The hash of the transaction to wait for. tx_hash: Felt, diff --git a/crates/katana/core/src/backend/contract.rs b/crates/katana/core/src/backend/contract.rs index 57966dc61c..1cfe9f57cf 100644 --- a/crates/katana/core/src/backend/contract.rs +++ b/crates/katana/core/src/backend/contract.rs @@ -1,6 +1,7 @@ use katana_primitives::class::DeprecatedCompiledClass; use starknet::core::types::FlattenedSierraClass; +#[derive(Debug)] pub enum StarknetContract { Legacy(DeprecatedCompiledClass), Sierra(FlattenedSierraClass), diff --git a/crates/katana/core/src/backend/mod.rs b/crates/katana/core/src/backend/mod.rs index b1a73c08ae..11fc549021 100644 --- a/crates/katana/core/src/backend/mod.rs +++ b/crates/katana/core/src/backend/mod.rs @@ -31,6 +31,7 @@ use crate::utils::get_current_timestamp; pub(crate) const LOG_TARGET: &str = "katana::core::backend"; +#[derive(Debug)] pub struct Backend { /// The config used to generate the backend. pub config: StarknetConfig, diff --git a/crates/katana/core/src/backend/storage.rs b/crates/katana/core/src/backend/storage.rs index ad484a9f59..29060bfae6 100644 --- a/crates/katana/core/src/backend/storage.rs +++ b/crates/katana/core/src/backend/storage.rs @@ -34,6 +34,7 @@ pub trait Database: + 'static + Send + Sync + + core::fmt::Debug { } @@ -54,9 +55,11 @@ impl Database for T where + 'static + Send + Sync + + core::fmt::Debug { } +#[derive(Debug)] pub struct Blockchain { inner: BlockchainProvider>, } diff --git a/crates/katana/core/src/sequencer.rs b/crates/katana/core/src/sequencer.rs index 0a0db8678d..5c71f865c3 100644 --- a/crates/katana/core/src/sequencer.rs +++ b/crates/katana/core/src/sequencer.rs @@ -47,6 +47,7 @@ pub struct SequencerConfig { pub messaging: Option, } +#[allow(missing_debug_implementations)] pub struct KatanaSequencer { pub config: SequencerConfig, pub pool: Arc, diff --git a/crates/katana/core/src/service/block_producer.rs b/crates/katana/core/src/service/block_producer.rs index 4205290389..9d3548be4e 100644 --- a/crates/katana/core/src/service/block_producer.rs +++ b/crates/katana/core/src/service/block_producer.rs @@ -68,6 +68,7 @@ type BlockProductionWithTxnsFuture = /// The type which responsible for block production. #[must_use = "BlockProducer does nothing unless polled"] +#[allow(missing_debug_implementations)] pub struct BlockProducer { /// The inner mode of mining. pub inner: RwLock>, @@ -149,12 +150,14 @@ impl BlockProducer { /// block producer will execute all the transactions in the mempool and mine a new block with the /// resulting state. The block context is only updated every time a new block is mined as opposed to /// updating it when the block is opened (in _interval_ mode). + +#[allow(missing_debug_implementations)] pub enum BlockProducerMode { Interval(IntervalBlockProducer), Instant(InstantBlockProducer), } -#[derive(Clone, derive_more::Deref)] +#[derive(Debug, Clone, derive_more::Deref)] pub struct PendingExecutor(#[deref] Arc>>>); impl PendingExecutor { @@ -163,6 +166,7 @@ impl PendingExecutor { } } +#[allow(missing_debug_implementations)] pub struct IntervalBlockProducer { /// The interval at which new blocks are mined. interval: Option, @@ -442,6 +446,7 @@ impl Stream for IntervalBlockProducer { } } +#[allow(missing_debug_implementations)] pub struct InstantBlockProducer { /// Holds the backend if no block is being mined backend: Arc>, diff --git a/crates/katana/core/src/service/messaging/ethereum.rs b/crates/katana/core/src/service/messaging/ethereum.rs index 90267b8a77..3977ab9e47 100644 --- a/crates/katana/core/src/service/messaging/ethereum.rs +++ b/crates/katana/core/src/service/messaging/ethereum.rs @@ -45,6 +45,7 @@ sol! { } } +#[derive(Debug)] pub struct EthereumMessaging { provider: Arc>, messaging_contract_address: Address, diff --git a/crates/katana/core/src/service/messaging/mod.rs b/crates/katana/core/src/service/messaging/mod.rs index f07b353e8c..7c40028b9b 100644 --- a/crates/katana/core/src/service/messaging/mod.rs +++ b/crates/katana/core/src/service/messaging/mod.rs @@ -162,6 +162,7 @@ pub trait Messenger { ) -> MessengerResult>; } +#[derive(Debug)] pub enum MessengerMode { Ethereum(EthereumMessaging), #[cfg(feature = "starknet-messaging")] diff --git a/crates/katana/core/src/service/messaging/service.rs b/crates/katana/core/src/service/messaging/service.rs index a4a6810c29..3f14983bf4 100644 --- a/crates/katana/core/src/service/messaging/service.rs +++ b/crates/katana/core/src/service/messaging/service.rs @@ -21,6 +21,7 @@ type MessagingFuture = Pin + Send>>; type MessageGatheringFuture = MessagingFuture>; type MessageSettlingFuture = MessagingFuture>>; +#[allow(missing_debug_implementations)] pub struct MessagingService { /// The interval at which the service will perform the messaging operations. interval: Interval, @@ -151,6 +152,7 @@ impl MessagingService { } } +#[derive(Debug)] pub enum MessagingOutcome { Gather { /// The latest block number of the settlement chain from which messages were gathered. diff --git a/crates/katana/core/src/service/messaging/starknet.rs b/crates/katana/core/src/service/messaging/starknet.rs index fc5d9083ce..d99406058b 100644 --- a/crates/katana/core/src/service/messaging/starknet.rs +++ b/crates/katana/core/src/service/messaging/starknet.rs @@ -29,6 +29,7 @@ const EXE_MAGIC: Felt = felt!("0x455845"); pub const HASH_EXEC: Felt = felt!("0xee"); +#[derive(Debug)] pub struct StarknetMessaging { chain_id: Felt, provider: AnyProvider, diff --git a/crates/katana/core/src/service/metrics.rs b/crates/katana/core/src/service/metrics.rs index 3749ab8c03..e773a1630f 100644 --- a/crates/katana/core/src/service/metrics.rs +++ b/crates/katana/core/src/service/metrics.rs @@ -1,6 +1,7 @@ use dojo_metrics::Metrics; use metrics::Counter; +#[derive(Debug)] pub(crate) struct ServiceMetrics { pub(crate) block_producer: BlockProducerMetrics, } diff --git a/crates/katana/core/src/service/mod.rs b/crates/katana/core/src/service/mod.rs index 01456be34b..694b305250 100644 --- a/crates/katana/core/src/service/mod.rs +++ b/crates/katana/core/src/service/mod.rs @@ -31,6 +31,7 @@ pub(crate) const LOG_TARGET: &str = "node"; /// This service is basically an endless future that continuously polls the miner which returns /// transactions for the next block, then those transactions are handed off to the [BlockProducer] /// to construct a new block. +#[allow(missing_debug_implementations)] pub struct NodeService { /// the pool that holds all transactions pub(crate) pool: Arc, @@ -120,6 +121,7 @@ impl Future for NodeService { } /// The type which takes the transaction from the pool and feeds them to the block producer. +#[derive(Debug)] pub struct TransactionMiner { /// stores whether there are pending transacions (if known) has_pending_txs: Option, diff --git a/crates/katana/executor/src/abstraction/executor.rs b/crates/katana/executor/src/abstraction/executor.rs index 7f2e6957c9..7395c03882 100644 --- a/crates/katana/executor/src/abstraction/executor.rs +++ b/crates/katana/executor/src/abstraction/executor.rs @@ -11,7 +11,7 @@ use crate::{ }; /// A type that can create [BlockExecutor] instance. -pub trait ExecutorFactory: Send + Sync + 'static { +pub trait ExecutorFactory: Send + Sync + 'static + core::fmt::Debug { /// Construct a new [BlockExecutor] with the given state. fn with_state<'a, P>(&self, state: P) -> Box + 'a> where @@ -31,7 +31,7 @@ pub trait ExecutorFactory: Send + Sync + 'static { } /// An executor that can execute a block of transactions. -pub trait BlockExecutor<'a>: ExecutorExt + Send + Sync { +pub trait BlockExecutor<'a>: ExecutorExt + Send + Sync + core::fmt::Debug { /// Executes the given block. fn execute_block(&mut self, block: ExecutableBlock) -> ExecutorResult<()>; diff --git a/crates/katana/executor/src/abstraction/mod.rs b/crates/katana/executor/src/abstraction/mod.rs index ae57d8ceb6..0dcf0e9b50 100644 --- a/crates/katana/executor/src/abstraction/mod.rs +++ b/crates/katana/executor/src/abstraction/mod.rs @@ -148,6 +148,7 @@ pub struct ResultAndStates { /// A wrapper around a boxed [StateProvider] for implementing the executor's own state reader /// traits. +#[derive(Debug)] pub struct StateProviderDb<'a>(pub(crate) Box); impl From> for StateProviderDb<'_> { diff --git a/crates/katana/executor/src/implementation/blockifier/mod.rs b/crates/katana/executor/src/implementation/blockifier/mod.rs index 94a344aab8..26de78046b 100644 --- a/crates/katana/executor/src/implementation/blockifier/mod.rs +++ b/crates/katana/executor/src/implementation/blockifier/mod.rs @@ -71,6 +71,7 @@ impl ExecutorFactory for BlockifierFactory { } } +#[derive(Debug)] pub struct StarknetVMProcessor<'a> { block_context: BlockContext, state: CachedState>, diff --git a/crates/katana/executor/src/implementation/blockifier/state.rs b/crates/katana/executor/src/implementation/blockifier/state.rs index 49d4b17462..2409a9f0cb 100644 --- a/crates/katana/executor/src/implementation/blockifier/state.rs +++ b/crates/katana/executor/src/implementation/blockifier/state.rs @@ -89,6 +89,7 @@ impl<'a> StateReader for StateProviderDb<'a> { } } +#[derive(Debug)] pub(super) struct CachedState(pub(super) Arc>>); impl Clone for CachedState { diff --git a/crates/katana/executor/src/implementation/noop.rs b/crates/katana/executor/src/implementation/noop.rs index 3e6931b0ac..d9f1e205e0 100644 --- a/crates/katana/executor/src/implementation/noop.rs +++ b/crates/katana/executor/src/implementation/noop.rs @@ -118,6 +118,7 @@ impl<'a> BlockExecutor<'a> for NoopExecutor { } } +#[derive(Debug)] struct NoopStateProvider; impl ContractClassProvider for NoopStateProvider { diff --git a/crates/katana/executor/src/implementation/sir/mod.rs b/crates/katana/executor/src/implementation/sir/mod.rs index 136e288703..6a687346dc 100644 --- a/crates/katana/executor/src/implementation/sir/mod.rs +++ b/crates/katana/executor/src/implementation/sir/mod.rs @@ -66,6 +66,7 @@ impl ExecutorFactory for NativeExecutorFactory { } } +#[derive(Debug)] pub struct StarknetVMProcessor<'a> { block_context: BlockContext, state: CachedState, PermanentContractClassCache>, diff --git a/crates/katana/primitives/src/genesis/allocation.rs b/crates/katana/primitives/src/genesis/allocation.rs index c267fee0fe..32f69c1e57 100644 --- a/crates/katana/primitives/src/genesis/allocation.rs +++ b/crates/katana/primitives/src/genesis/allocation.rs @@ -224,6 +224,7 @@ impl From for GenesisAllocation { /// A helper type for allocating dev accounts in the genesis block. #[must_use] +#[derive(Debug)] pub struct DevAllocationsGenerator { total: u16, seed: [u8; 32], diff --git a/crates/katana/primitives/src/transaction.rs b/crates/katana/primitives/src/transaction.rs index e4a4d0537d..fbbd754170 100644 --- a/crates/katana/primitives/src/transaction.rs +++ b/crates/katana/primitives/src/transaction.rs @@ -26,6 +26,7 @@ pub enum Tx { DeployAccount(DeployAccountTx), } +#[derive(Debug)] pub enum TxRef<'a> { Invoke(&'a InvokeTx), Declare(&'a DeclareTx), diff --git a/crates/katana/rpc/rpc-types-builder/src/block.rs b/crates/katana/rpc/rpc-types-builder/src/block.rs index 537da569d0..53638b1efa 100644 --- a/crates/katana/rpc/rpc-types-builder/src/block.rs +++ b/crates/katana/rpc/rpc-types-builder/src/block.rs @@ -5,6 +5,7 @@ use katana_provider::ProviderResult; use katana_rpc_types::block::{BlockWithReceipts, BlockWithTxHashes, BlockWithTxs}; /// A builder for building RPC block types. +#[derive(Debug)] pub struct BlockBuilder

{ provider: P, block_id: BlockHashOrNumber, diff --git a/crates/katana/rpc/rpc-types-builder/src/receipt.rs b/crates/katana/rpc/rpc-types-builder/src/receipt.rs index d46e85c389..05d220787b 100644 --- a/crates/katana/rpc/rpc-types-builder/src/receipt.rs +++ b/crates/katana/rpc/rpc-types-builder/src/receipt.rs @@ -5,6 +5,7 @@ use katana_provider::traits::transaction::{ use katana_rpc_types::receipt::{ReceiptBlock, TxReceiptWithBlockInfo}; /// A builder for building RPC transaction receipt types. +#[derive(Debug)] pub struct ReceiptBuilder

{ provider: P, transaction_hash: TxHash, diff --git a/crates/katana/rpc/rpc-types-builder/src/state_update.rs b/crates/katana/rpc/rpc-types-builder/src/state_update.rs index 6b82b0748a..9f0fa78d0c 100644 --- a/crates/katana/rpc/rpc-types-builder/src/state_update.rs +++ b/crates/katana/rpc/rpc-types-builder/src/state_update.rs @@ -7,6 +7,7 @@ use katana_provider::ProviderResult; use katana_rpc_types::state_update::{StateDiff, StateUpdate}; /// A builder for building RPC state update type. +#[derive(Debug)] pub struct StateUpdateBuilder

{ provider: P, block_id: BlockHashOrNumber, diff --git a/crates/katana/rpc/rpc-types/src/trace.rs b/crates/katana/rpc/rpc-types/src/trace.rs index 938ca9485a..f071eb5f89 100644 --- a/crates/katana/rpc/rpc-types/src/trace.rs +++ b/crates/katana/rpc/rpc-types/src/trace.rs @@ -5,6 +5,7 @@ use starknet::core::types::{ CallType, ComputationResources, EntryPointType, OrderedEvent, OrderedMessage, }; +#[derive(Debug)] pub struct FunctionInvocation(pub starknet::core::types::FunctionInvocation); impl From for FunctionInvocation { diff --git a/crates/katana/rpc/rpc/src/dev.rs b/crates/katana/rpc/rpc/src/dev.rs index e90290c1c5..db7a189984 100644 --- a/crates/katana/rpc/rpc/src/dev.rs +++ b/crates/katana/rpc/rpc/src/dev.rs @@ -7,6 +7,7 @@ use katana_primitives::FieldElement; use katana_rpc_api::dev::DevApiServer; use katana_rpc_types::error::katana::KatanaApiError; +#[allow(missing_debug_implementations)] pub struct DevApi { sequencer: Arc>, } diff --git a/crates/katana/rpc/rpc/src/katana.rs b/crates/katana/rpc/rpc/src/katana.rs index 46e5f61c68..fdd01ec2fc 100644 --- a/crates/katana/rpc/rpc/src/katana.rs +++ b/crates/katana/rpc/rpc/src/katana.rs @@ -6,6 +6,7 @@ use katana_executor::ExecutorFactory; use katana_rpc_api::katana::KatanaApiServer; use katana_rpc_types::account::Account; +#[allow(missing_debug_implementations)] pub struct KatanaApi { sequencer: Arc>, } diff --git a/crates/katana/rpc/rpc/src/saya.rs b/crates/katana/rpc/rpc/src/saya.rs index 317b128056..b6e6f7da5b 100644 --- a/crates/katana/rpc/rpc/src/saya.rs +++ b/crates/katana/rpc/rpc/src/saya.rs @@ -12,6 +12,7 @@ use katana_rpc_types::error::saya::SayaApiError; use katana_rpc_types::trace::TxExecutionInfo; use katana_tasks::TokioTaskSpawner; +#[allow(missing_debug_implementations)] pub struct SayaApi { sequencer: Arc>, } diff --git a/crates/katana/rpc/rpc/src/starknet.rs b/crates/katana/rpc/rpc/src/starknet.rs index f1e616ee58..19b5515c52 100644 --- a/crates/katana/rpc/rpc/src/starknet.rs +++ b/crates/katana/rpc/rpc/src/starknet.rs @@ -43,6 +43,7 @@ use starknet::core::types::{ TransactionExecutionStatus, TransactionStatus, TransactionTrace, }; +#[allow(missing_debug_implementations)] pub struct StarknetApi { inner: Arc>, } diff --git a/crates/katana/rpc/rpc/src/torii.rs b/crates/katana/rpc/rpc/src/torii.rs index ec2b8ff821..60a957fe37 100644 --- a/crates/katana/rpc/rpc/src/torii.rs +++ b/crates/katana/rpc/rpc/src/torii.rs @@ -16,6 +16,7 @@ use katana_tasks::TokioTaskSpawner; const MAX_PAGE_SIZE: usize = 100; +#[allow(missing_debug_implementations)] pub struct ToriiApi { sequencer: Arc>, } diff --git a/crates/katana/runner/src/logs.rs b/crates/katana/runner/src/logs.rs index 29d70da32e..cdaa7a7ebe 100644 --- a/crates/katana/runner/src/logs.rs +++ b/crates/katana/runner/src/logs.rs @@ -8,7 +8,7 @@ use tokio::time::sleep; use crate::KatanaRunner; -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Debug)] pub struct TimedLog { timestamp: String, level: String, @@ -16,7 +16,7 @@ pub struct TimedLog { target: String, } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Debug)] pub struct Message { message: String, } diff --git a/crates/katana/storage/provider/src/lib.rs b/crates/katana/storage/provider/src/lib.rs index 3f5581d94c..41750e2d90 100644 --- a/crates/katana/storage/provider/src/lib.rs +++ b/crates/katana/storage/provider/src/lib.rs @@ -38,6 +38,7 @@ pub type ProviderResult = Result; /// /// Serves as the main entrypoint for interacting with the storage storage. Every read/write /// operation is done through this provider. +#[derive(Debug)] pub struct BlockchainProvider { provider: Db, } diff --git a/crates/katana/storage/provider/src/providers/db/state.rs b/crates/katana/storage/provider/src/providers/db/state.rs index bb8f070646..d00db681b2 100644 --- a/crates/katana/storage/provider/src/providers/db/state.rs +++ b/crates/katana/storage/provider/src/providers/db/state.rs @@ -99,6 +99,7 @@ impl ContractClassWriter for DbProvider { } /// A state provider that provides the latest states from the database. +#[derive(Debug)] pub(super) struct LatestStateProvider(mdbx::tx::TxRO); impl LatestStateProvider { @@ -156,6 +157,7 @@ impl StateProvider for LatestStateProvider { } /// A historical state provider. +#[derive(Debug)] pub(super) struct HistoricalStateProvider { /// The database transaction used to read the database. tx: mdbx::tx::TxRO, diff --git a/crates/katana/storage/provider/src/providers/fork/backend.rs b/crates/katana/storage/provider/src/providers/fork/backend.rs index 5d3bfd9f6e..72756fd803 100644 --- a/crates/katana/storage/provider/src/providers/fork/backend.rs +++ b/crates/katana/storage/provider/src/providers/fork/backend.rs @@ -115,6 +115,7 @@ type BackendRequestFuture = BoxFuture<'static, ()>; /// /// It is responsible for processing [requests](BackendRequest) to fetch data from the remote /// provider. +#[allow(missing_debug_implementations)] pub struct Backend

{ /// The Starknet RPC provider that will be used to fetch data from. provider: Arc

, @@ -294,6 +295,7 @@ where /// /// This is the primary interface for sending request to the backend to fetch data from the remote /// network. +#[derive(Debug)] pub struct BackendHandle(Mutex>); impl Clone for BackendHandle { @@ -371,7 +373,7 @@ impl BackendHandle { /// Check in cache first, if not found, then fetch from the forked provider and store it in the /// cache to avoid fetching it again. This is shared across multiple instances of /// [`ForkedStateDb`](super::state::ForkedStateDb). -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct SharedStateProvider(pub(crate) Arc>); impl SharedStateProvider { diff --git a/crates/katana/storage/provider/src/providers/fork/mod.rs b/crates/katana/storage/provider/src/providers/fork/mod.rs index 0e55e1b99d..114857d4c6 100644 --- a/crates/katana/storage/provider/src/providers/fork/mod.rs +++ b/crates/katana/storage/provider/src/providers/fork/mod.rs @@ -38,6 +38,7 @@ use crate::traits::transaction::{ }; use crate::ProviderResult; +#[derive(Debug)] pub struct ForkedProvider { // TODO: insert `ForkedBackend` into `CacheDb` storage: RwLock>, diff --git a/crates/katana/storage/provider/src/providers/fork/state.rs b/crates/katana/storage/provider/src/providers/fork/state.rs index 83e099c28e..d2de6e065f 100644 --- a/crates/katana/storage/provider/src/providers/fork/state.rs +++ b/crates/katana/storage/provider/src/providers/fork/state.rs @@ -102,6 +102,7 @@ impl ContractClassProvider for CacheStateDb { } } +#[derive(Debug)] pub(super) struct LatestStateProvider(pub(super) Arc); impl StateProvider for LatestStateProvider { diff --git a/crates/katana/storage/provider/src/providers/in_memory/cache.rs b/crates/katana/storage/provider/src/providers/in_memory/cache.rs index 6bd193b08c..d5b1df7685 100644 --- a/crates/katana/storage/provider/src/providers/in_memory/cache.rs +++ b/crates/katana/storage/provider/src/providers/in_memory/cache.rs @@ -18,12 +18,13 @@ type SierraClassesMap = HashMap; type CompiledClassesMap = HashMap; type CompiledClassHashesMap = HashMap; -#[derive(Default)] +#[derive(Default, Debug)] pub struct SharedContractClasses { pub(crate) sierra_classes: RwLock, pub(crate) compiled_classes: RwLock, } +#[derive(Debug)] pub struct CacheSnapshotWithoutClasses { pub(crate) db: Db, pub(crate) storage: ContractStorageMap, @@ -31,6 +32,7 @@ pub struct CacheSnapshotWithoutClasses { pub(crate) compiled_class_hashes: CompiledClassHashesMap, } +#[derive(Debug)] pub struct CacheStateDb { pub(crate) db: Db, pub(crate) storage: RwLock, @@ -69,6 +71,7 @@ impl CacheStateDb { } } +#[derive(Debug)] pub struct CacheDb { pub(crate) db: Db, pub(crate) block_headers: HashMap, diff --git a/crates/katana/storage/provider/src/providers/in_memory/mod.rs b/crates/katana/storage/provider/src/providers/in_memory/mod.rs index f59d0ec94a..6a27bad218 100644 --- a/crates/katana/storage/provider/src/providers/in_memory/mod.rs +++ b/crates/katana/storage/provider/src/providers/in_memory/mod.rs @@ -34,6 +34,7 @@ use crate::traits::transaction::{ }; use crate::ProviderResult; +#[derive(Debug)] pub struct InMemoryProvider { storage: RwLock>, state: Arc, diff --git a/crates/katana/storage/provider/src/providers/in_memory/state.rs b/crates/katana/storage/provider/src/providers/in_memory/state.rs index c50c254f2d..8a7adf7b2f 100644 --- a/crates/katana/storage/provider/src/providers/in_memory/state.rs +++ b/crates/katana/storage/provider/src/providers/in_memory/state.rs @@ -10,6 +10,7 @@ use crate::traits::contract::ContractClassProvider; use crate::traits::state::StateProvider; use crate::ProviderResult; +#[derive(Debug)] pub struct StateSnapshot { // because the classes are shared between snapshots, when trying to fetch check the compiled // hash first and then the sierra class to ensure the class should be present in the snapshot. @@ -23,6 +24,7 @@ const MIN_HISTORY_LIMIT: usize = 10; /// Represents the complete state of a single block. /// /// It should store at N - 1 states, where N is the latest block number. +#[derive(Debug)] pub struct HistoricalStates { /// The states at a certain block based on the block number states: HashMap>, @@ -165,6 +167,7 @@ impl ContractClassProvider for InMemorySnapshot { } } +#[derive(Debug)] pub(super) struct LatestStateProvider(pub(super) Arc); impl StateProvider for LatestStateProvider { diff --git a/crates/katana/storage/provider/src/traits/state.rs b/crates/katana/storage/provider/src/traits/state.rs index 3ec9aade09..3c80891aac 100644 --- a/crates/katana/storage/provider/src/traits/state.rs +++ b/crates/katana/storage/provider/src/traits/state.rs @@ -13,7 +13,7 @@ pub trait StateRootProvider: Send + Sync { } #[auto_impl::auto_impl(&, Box, Arc)] -pub trait StateProvider: ContractClassProvider + Send + Sync { +pub trait StateProvider: ContractClassProvider + Send + Sync + std::fmt::Debug { /// Returns the nonce of a contract. fn nonce(&self, address: ContractAddress) -> ProviderResult>; diff --git a/crates/saya/core/src/blockchain/mod.rs b/crates/saya/core/src/blockchain/mod.rs index 0d301de6d4..a225b3c64a 100644 --- a/crates/saya/core/src/blockchain/mod.rs +++ b/crates/saya/core/src/blockchain/mod.rs @@ -62,6 +62,7 @@ impl Database for T where } /// Represents the whole blockchain fetched from Katana. +#[allow(missing_debug_implementations)] pub struct Blockchain { inner: BlockchainProvider>, } diff --git a/crates/saya/core/src/data_availability/celestia/mod.rs b/crates/saya/core/src/data_availability/celestia/mod.rs index 51372e7910..9388b96ae3 100644 --- a/crates/saya/core/src/data_availability/celestia/mod.rs +++ b/crates/saya/core/src/data_availability/celestia/mod.rs @@ -31,6 +31,7 @@ impl Display for CelestiaConfig { } } +#[allow(missing_debug_implementations)] pub struct CelestiaClient { client: Client, mode: DataAvailabilityMode, diff --git a/crates/saya/core/src/lib.rs b/crates/saya/core/src/lib.rs index 030b2bd6ca..f200663f42 100644 --- a/crates/saya/core/src/lib.rs +++ b/crates/saya/core/src/lib.rs @@ -86,6 +86,7 @@ where } /// Saya. +#[allow(missing_debug_implementations)] pub struct Saya { /// The main Saya configuration. config: SayaConfig, diff --git a/crates/saya/core/src/prover/mod.rs b/crates/saya/core/src/prover/mod.rs index 420cce9bde..a4b5ffe570 100644 --- a/crates/saya/core/src/prover/mod.rs +++ b/crates/saya/core/src/prover/mod.rs @@ -33,6 +33,7 @@ pub enum ProverIdentifier { Http(Arc), } +#[derive(Debug)] pub enum ProveProgram { Differ, Merger, diff --git a/crates/saya/core/src/prover/scheduler.rs b/crates/saya/core/src/prover/scheduler.rs index 3f90eab46f..72fdadcd0c 100644 --- a/crates/saya/core/src/prover/scheduler.rs +++ b/crates/saya/core/src/prover/scheduler.rs @@ -22,6 +22,7 @@ pub enum ProvingState { } type ProvingStateWithBlock = (u64, ProvingState); +#[allow(missing_debug_implementations)] pub struct Scheduler { root_task: BoxFuture<'static, anyhow::Result<(Proof, ProgramInput)>>, free_differs: Vec>, diff --git a/crates/saya/core/src/prover/state_diff.rs b/crates/saya/core/src/prover/state_diff.rs index 3e68cd41f9..838b72f20c 100644 --- a/crates/saya/core/src/prover/state_diff.rs +++ b/crates/saya/core/src/prover/state_diff.rs @@ -1,6 +1,7 @@ use katana_primitives::state::StateUpdates; use starknet::core::types::Felt; +#[derive(Debug)] pub struct ProvedStateDiff { pub genesis_state_hash: Felt, pub prev_state_hash: Felt, diff --git a/crates/saya/core/src/prover/stone_image.rs b/crates/saya/core/src/prover/stone_image.rs index b6d3e655d0..aae10a90e2 100644 --- a/crates/saya/core/src/prover/stone_image.rs +++ b/crates/saya/core/src/prover/stone_image.rs @@ -14,7 +14,7 @@ use crate::LOG_TARGET; const PROVER_IMAGE: &str = "neotheprogramist/stone-cairo0:latest"; -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct StoneProver(pub String); pub async fn prove_stone(input: String, prove_program: ProveProgram) -> anyhow::Result { diff --git a/crates/saya/provider/src/rpc/mod.rs b/crates/saya/provider/src/rpc/mod.rs index 45e9993b05..1758a70866 100644 --- a/crates/saya/provider/src/rpc/mod.rs +++ b/crates/saya/provider/src/rpc/mod.rs @@ -32,6 +32,7 @@ mod state; mod transaction; /// A JSON RPC provider. +#[derive(Debug)] pub struct JsonRpcProvider { /// The RPC URL that must be kept for custom endpoints. rpc_url: String, diff --git a/crates/sozo/ops/src/account.rs b/crates/sozo/ops/src/account.rs index 1791526cc3..4fb7f38307 100644 --- a/crates/sozo/ops/src/account.rs +++ b/crates/sozo/ops/src/account.rs @@ -31,7 +31,7 @@ pub type ClassHash = Felt; pub const DEFAULT_OZ_ACCOUNT_CONTRACT_CLASS_HASH: ClassHash = felt!("0x05400e90f7e0ae78bd02c77cd75527280470e2fe19c54970dd79dc37a9d3645c"); -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Debug)] pub struct AccountConfig { pub version: u64, pub variant: AccountVariant, @@ -58,14 +58,14 @@ impl AccountConfig { } } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Debug)] #[serde(tag = "type", rename_all = "snake_case")] pub enum AccountVariant { OpenZeppelin(OzAccountConfig), } #[serde_as] -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Debug)] pub struct OzAccountConfig { pub version: u64, #[serde_as(as = "UfeHex")] @@ -74,7 +74,7 @@ pub struct OzAccountConfig { pub legacy: bool, } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Debug)] #[serde(tag = "status", rename_all = "snake_case")] pub enum DeploymentStatus { Undeployed(UndeployedStatus), @@ -98,7 +98,7 @@ impl DeploymentStatus { } #[serde_as] -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Debug)] pub struct UndeployedStatus { #[serde_as(as = "UfeHex")] pub class_hash: Felt, @@ -107,7 +107,7 @@ pub struct UndeployedStatus { } #[serde_as] -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Debug)] pub struct DeployedStatus { #[serde_as(as = "UfeHex")] pub class_hash: Felt, diff --git a/crates/torii/client/src/client/mod.rs b/crates/torii/client/src/client/mod.rs index e1265227de..fb71a18a11 100644 --- a/crates/torii/client/src/client/mod.rs +++ b/crates/torii/client/src/client/mod.rs @@ -31,6 +31,7 @@ use crate::client::subscription::{ // TODO: remove reliance on RPC #[allow(unused)] +#[derive(Debug)] pub struct Client { /// Metadata of the World that the client is connected to. metadata: Arc>, diff --git a/crates/torii/client/src/client/storage.rs b/crates/torii/client/src/client/storage.rs index b5da49d1cc..2e3672de36 100644 --- a/crates/torii/client/src/client/storage.rs +++ b/crates/torii/client/src/client/storage.rs @@ -16,6 +16,7 @@ pub type StorageValue = Felt; /// An in-memory storage for storing the component values of entities. // TODO: check if we can use sql db instead. +#[derive(Debug)] pub struct ModelStorage { metadata: Arc>, storage: RwLock>, diff --git a/crates/torii/client/src/client/subscription.rs b/crates/torii/client/src/client/subscription.rs index 7bd7f7bca1..dfce86d1af 100644 --- a/crates/torii/client/src/client/subscription.rs +++ b/crates/torii/client/src/client/subscription.rs @@ -17,10 +17,12 @@ use crate::client::error::Error; use crate::client::storage::ModelStorage; use crate::utils::compute_all_storage_addresses; +#[derive(Debug)] pub enum SubscriptionEvent { UpdateSubsciptionStream(ModelDiffsStreaming), } +#[derive(Debug)] pub struct SubscribedModels { metadata: Arc>, pub(crate) models_keys: RwLock>, @@ -126,6 +128,7 @@ impl SubscriptionClientHandle { } #[must_use = "SubscriptionClient does nothing unless polled"] +#[allow(missing_debug_implementations)] pub struct SubscriptionService { req_rcv: Receiver, /// Model Diff stream by subscription server to receive response diff --git a/crates/torii/core/src/cache.rs b/crates/torii/core/src/cache.rs index 9afbf0c5e8..a680f39ec7 100644 --- a/crates/torii/core/src/cache.rs +++ b/crates/torii/core/src/cache.rs @@ -8,6 +8,7 @@ use tokio::sync::RwLock; use crate::error::{Error, QueryError}; use crate::model::{parse_sql_model_members, SqlModelMember}; +#[derive(Debug)] pub struct ModelCache { pool: SqlitePool, cache: RwLock>, diff --git a/crates/torii/core/src/engine.rs b/crates/torii/core/src/engine.rs index 9e1d7906f6..b2913c41b0 100644 --- a/crates/torii/core/src/engine.rs +++ b/crates/torii/core/src/engine.rs @@ -1,4 +1,5 @@ use std::collections::BTreeMap; +use std::fmt::Debug; use std::time::Duration; use anyhow::Result; @@ -17,7 +18,7 @@ use tracing::{error, info, trace, warn}; use crate::processors::{BlockProcessor, EventProcessor, TransactionProcessor}; use crate::sql::Sql; - +#[allow(missing_debug_implementations)] pub struct Processors { pub block: Vec>>, pub transaction: Vec>>, @@ -51,6 +52,7 @@ impl Default for EngineConfig { } } +#[allow(missing_debug_implementations)] pub struct Engine { world: WorldContractReader

, db: Sql, diff --git a/crates/torii/core/src/lib.rs b/crates/torii/core/src/lib.rs index bf88c9fd51..2697bbcec8 100644 --- a/crates/torii/core/src/lib.rs +++ b/crates/torii/core/src/lib.rs @@ -15,7 +15,7 @@ pub mod types; pub mod utils; #[allow(dead_code)] -#[derive(FromRow, Deserialize)] +#[derive(FromRow, Deserialize, Debug)] pub struct World { #[sqlx(try_from = "String")] world_address: SQLFelt, diff --git a/crates/torii/core/src/model.rs b/crates/torii/core/src/model.rs index cc449674d6..28ce30ba2e 100644 --- a/crates/torii/core/src/model.rs +++ b/crates/torii/core/src/model.rs @@ -14,6 +14,7 @@ use starknet::core::types::Felt; use super::error::{self, Error}; use crate::error::{ParseError, QueryError}; +#[derive(Debug)] pub struct ModelSQLReader { /// Namespace of the model namespace: String, diff --git a/crates/torii/core/src/processors/event_message.rs b/crates/torii/core/src/processors/event_message.rs index ff36452817..a3c06fc762 100644 --- a/crates/torii/core/src/processors/event_message.rs +++ b/crates/torii/core/src/processors/event_message.rs @@ -12,13 +12,13 @@ use crate::sql::Sql; pub(crate) const LOG_TARGET: &str = "torii_core::processors::event_message"; -#[derive(Default)] +#[derive(Default, Debug)] pub struct EventMessageProcessor; #[async_trait] impl

EventProcessor

for EventMessageProcessor where - P: Provider + Send + Sync, + P: Provider + Send + Sync + std::fmt::Debug, { fn event_key(&self) -> String { "".to_string() diff --git a/crates/torii/core/src/processors/metadata_update.rs b/crates/torii/core/src/processors/metadata_update.rs index 12bd45e46e..a25d02f535 100644 --- a/crates/torii/core/src/processors/metadata_update.rs +++ b/crates/torii/core/src/processors/metadata_update.rs @@ -21,13 +21,13 @@ const MAX_RETRY: u8 = 3; pub(crate) const LOG_TARGET: &str = "torii_core::processors::metadata_update"; -#[derive(Default)] +#[derive(Default, Debug)] pub struct MetadataUpdateProcessor; #[async_trait] impl

EventProcessor

for MetadataUpdateProcessor where - P: Provider + Send + Sync, + P: Provider + Send + Sync + std::fmt::Debug, { fn event_key(&self) -> String { "MetadataUpdate".to_string() diff --git a/crates/torii/core/src/processors/register_model.rs b/crates/torii/core/src/processors/register_model.rs index e7d36f494f..429c654c44 100644 --- a/crates/torii/core/src/processors/register_model.rs +++ b/crates/torii/core/src/processors/register_model.rs @@ -12,13 +12,13 @@ use crate::sql::Sql; pub(crate) const LOG_TARGET: &str = "torii_core::processors::register_model"; -#[derive(Default)] +#[derive(Default, Debug)] pub struct RegisterModelProcessor; #[async_trait] impl

EventProcessor

for RegisterModelProcessor where - P: Provider + Send + Sync, + P: Provider + Send + Sync + std::fmt::Debug, { fn event_key(&self) -> String { "ModelRegistered".to_string() diff --git a/crates/torii/core/src/processors/store_del_record.rs b/crates/torii/core/src/processors/store_del_record.rs index 69439a7754..7917ff1093 100644 --- a/crates/torii/core/src/processors/store_del_record.rs +++ b/crates/torii/core/src/processors/store_del_record.rs @@ -12,13 +12,13 @@ use crate::sql::Sql; pub(crate) const LOG_TARGET: &str = "torii_core::processors::store_del_record"; -#[derive(Default)] +#[derive(Default, Debug)] pub struct StoreDelRecordProcessor; #[async_trait] impl

EventProcessor

for StoreDelRecordProcessor where - P: Provider + Send + Sync, + P: Provider + Send + Sync + std::fmt::Debug, { fn event_key(&self) -> String { "StoreDelRecord".to_string() diff --git a/crates/torii/core/src/processors/store_set_record.rs b/crates/torii/core/src/processors/store_set_record.rs index 30b63302d4..6641e19b16 100644 --- a/crates/torii/core/src/processors/store_set_record.rs +++ b/crates/torii/core/src/processors/store_set_record.rs @@ -13,13 +13,13 @@ use crate::sql::Sql; pub(crate) const LOG_TARGET: &str = "torii_core::processors::store_set_record"; -#[derive(Default)] +#[derive(Default, Debug)] pub struct StoreSetRecordProcessor; #[async_trait] impl

EventProcessor

for StoreSetRecordProcessor where - P: Provider + Send + Sync, + P: Provider + Send + Sync + std::fmt::Debug, { fn event_key(&self) -> String { "StoreSetRecord".to_string() diff --git a/crates/torii/core/src/processors/store_transaction.rs b/crates/torii/core/src/processors/store_transaction.rs index b94d5552a2..d058b7ed31 100644 --- a/crates/torii/core/src/processors/store_transaction.rs +++ b/crates/torii/core/src/processors/store_transaction.rs @@ -6,11 +6,11 @@ use starknet::providers::Provider; use super::TransactionProcessor; use crate::sql::Sql; -#[derive(Default)] +#[derive(Default, Debug)] pub struct StoreTransactionProcessor; #[async_trait] -impl TransactionProcessor

for StoreTransactionProcessor { +impl TransactionProcessor

for StoreTransactionProcessor { async fn process( &self, db: &mut Sql, diff --git a/crates/torii/core/src/simple_broker.rs b/crates/torii/core/src/simple_broker.rs index d254c3008b..37bdb2118d 100644 --- a/crates/torii/core/src/simple_broker.rs +++ b/crates/torii/core/src/simple_broker.rs @@ -12,6 +12,7 @@ use slab::Slab; static SUBSCRIBERS: Lazy>>> = Lazy::new(Default::default); +#[derive(Debug)] pub struct Senders(pub Slab>); struct BrokerStream(usize, UnboundedReceiver); @@ -42,6 +43,7 @@ impl Stream for BrokerStream { } } +#[derive(Debug)] /// A simple broker based on memory pub struct SimpleBroker(PhantomData); diff --git a/crates/torii/core/src/sql_test.rs b/crates/torii/core/src/sql_test.rs index 4bb96ff80c..480a06e6ce 100644 --- a/crates/torii/core/src/sql_test.rs +++ b/crates/torii/core/src/sql_test.rs @@ -33,7 +33,7 @@ pub async fn bootstrap_engine

( provider: P, ) -> Result, Box> where - P: Provider + Send + Sync, + P: Provider + Send + Sync + core::fmt::Debug, { let (shutdown_tx, _) = broadcast::channel(1); let mut engine = Engine::new( diff --git a/crates/torii/core/src/types.rs b/crates/torii/core/src/types.rs index 2eec61cbcb..00f2d47f11 100644 --- a/crates/torii/core/src/types.rs +++ b/crates/torii/core/src/types.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; use sqlx::FromRow; use starknet::core::types::Felt; -#[derive(Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize)] pub struct SQLFelt(pub Felt); impl From for Felt { diff --git a/crates/torii/graphql/src/object/connection/edge.rs b/crates/torii/graphql/src/object/connection/edge.rs index b43e5814af..8874bc2ced 100644 --- a/crates/torii/graphql/src/object/connection/edge.rs +++ b/crates/torii/graphql/src/object/connection/edge.rs @@ -4,6 +4,7 @@ use async_graphql::Name; use crate::object::BasicObject; use crate::types::{GraphqlType, TypeData, TypeMapping}; +#[derive(Debug)] pub struct EdgeObject { pub name: String, pub type_name: String, diff --git a/crates/torii/graphql/src/object/connection/mod.rs b/crates/torii/graphql/src/object/connection/mod.rs index 9dfb2ae9e8..dc9931ac58 100644 --- a/crates/torii/graphql/src/object/connection/mod.rs +++ b/crates/torii/graphql/src/object/connection/mod.rs @@ -27,6 +27,7 @@ pub struct ConnectionArguments { pub limit: Option, } +#[derive(Debug)] pub struct ConnectionObject { pub name: String, pub type_name: String, diff --git a/crates/torii/graphql/src/object/connection/page_info.rs b/crates/torii/graphql/src/object/connection/page_info.rs index 5cf286df26..9f6028ac43 100644 --- a/crates/torii/graphql/src/object/connection/page_info.rs +++ b/crates/torii/graphql/src/object/connection/page_info.rs @@ -6,6 +6,7 @@ use crate::constants::{PAGE_INFO_NAMES, PAGE_INFO_TYPE_NAME}; use crate::mapping::PAGE_INFO_TYPE_MAPPING; use crate::object::{BasicObject, TypeMapping}; +#[derive(Debug)] pub struct PageInfoObject; impl BasicObject for PageInfoObject { diff --git a/crates/torii/graphql/src/object/entity.rs b/crates/torii/graphql/src/object/entity.rs index f37873c16b..92737ba9c8 100644 --- a/crates/torii/graphql/src/object/entity.rs +++ b/crates/torii/graphql/src/object/entity.rs @@ -20,6 +20,8 @@ use crate::object::{resolve_many, resolve_one}; use crate::query::{type_mapping_query, value_mapping_from_row}; use crate::types::TypeData; use crate::utils; + +#[derive(Debug)] pub struct EntityObject; impl BasicObject for EntityObject { diff --git a/crates/torii/graphql/src/object/event.rs b/crates/torii/graphql/src/object/event.rs index f0063f76c1..e171e31227 100644 --- a/crates/torii/graphql/src/object/event.rs +++ b/crates/torii/graphql/src/object/event.rs @@ -13,6 +13,7 @@ use crate::constants::{DATETIME_FORMAT, EVENT_NAMES, EVENT_TABLE, EVENT_TYPE_NAM use crate::mapping::EVENT_TYPE_MAPPING; use crate::types::ValueMapping; +#[derive(Debug)] pub struct EventObject; impl BasicObject for EventObject { diff --git a/crates/torii/graphql/src/object/event_message.rs b/crates/torii/graphql/src/object/event_message.rs index 007573b3ca..b1b815537c 100644 --- a/crates/torii/graphql/src/object/event_message.rs +++ b/crates/torii/graphql/src/object/event_message.rs @@ -20,6 +20,8 @@ use crate::object::{resolve_many, resolve_one}; use crate::query::{type_mapping_query, value_mapping_from_row}; use crate::types::TypeData; use crate::utils::extract; + +#[derive(Debug)] pub struct EventMessageObject; impl BasicObject for EventMessageObject { diff --git a/crates/torii/graphql/src/object/inputs/order_input.rs b/crates/torii/graphql/src/object/inputs/order_input.rs index d7386200ce..ed5cd1b02e 100644 --- a/crates/torii/graphql/src/object/inputs/order_input.rs +++ b/crates/torii/graphql/src/object/inputs/order_input.rs @@ -5,6 +5,7 @@ use crate::constants::{ORDER_ASC, ORDER_DESC, ORDER_DIR_TYPE_NAME}; use crate::object::TypeMapping; use crate::query::order::{Direction, Order}; +#[derive(Debug)] pub struct OrderInputObject { pub type_name: String, pub type_mapping: TypeMapping, diff --git a/crates/torii/graphql/src/object/inputs/where_input.rs b/crates/torii/graphql/src/object/inputs/where_input.rs index 86e817a0ba..3c48e33143 100644 --- a/crates/torii/graphql/src/object/inputs/where_input.rs +++ b/crates/torii/graphql/src/object/inputs/where_input.rs @@ -12,6 +12,7 @@ use crate::object::TypeMapping; use crate::query::filter::{parse_filter, Comparator, Filter, FilterValue}; use crate::types::TypeData; +#[derive(Debug)] pub struct WhereInputObject { pub type_name: String, pub type_mapping: TypeMapping, diff --git a/crates/torii/graphql/src/object/metadata/content.rs b/crates/torii/graphql/src/object/metadata/content.rs index b340b1593a..02abec1c1f 100644 --- a/crates/torii/graphql/src/object/metadata/content.rs +++ b/crates/torii/graphql/src/object/metadata/content.rs @@ -3,6 +3,7 @@ use crate::constants::{CONTENT_NAMES, CONTENT_TYPE_NAME}; use crate::mapping::CONTENT_TYPE_MAPPING; use crate::object::BasicObject; +#[derive(Debug)] pub struct ContentObject; impl BasicObject for ContentObject { diff --git a/crates/torii/graphql/src/object/metadata/mod.rs b/crates/torii/graphql/src/object/metadata/mod.rs index 6c7c452717..07a7771380 100644 --- a/crates/torii/graphql/src/object/metadata/mod.rs +++ b/crates/torii/graphql/src/object/metadata/mod.rs @@ -19,6 +19,7 @@ use crate::types::{TypeMapping, ValueMapping}; pub mod content; pub mod social; +#[derive(Debug)] pub struct MetadataObject; impl MetadataObject { diff --git a/crates/torii/graphql/src/object/metadata/social.rs b/crates/torii/graphql/src/object/metadata/social.rs index 293f00b139..dcd27dc344 100644 --- a/crates/torii/graphql/src/object/metadata/social.rs +++ b/crates/torii/graphql/src/object/metadata/social.rs @@ -3,6 +3,7 @@ use crate::constants::{SOCIAL_NAMES, SOCIAL_TYPE_NAME}; use crate::mapping::SOCIAL_TYPE_MAPPING; use crate::object::BasicObject; +#[derive(Debug)] pub struct SocialObject; impl BasicObject for SocialObject { diff --git a/crates/torii/graphql/src/object/mod.rs b/crates/torii/graphql/src/object/mod.rs index 916b7b840e..c1046ffbe4 100644 --- a/crates/torii/graphql/src/object/mod.rs +++ b/crates/torii/graphql/src/object/mod.rs @@ -26,6 +26,7 @@ use crate::query::value_mapping_from_row; use crate::types::{TypeMapping, ValueMapping}; use crate::utils::extract; +#[allow(missing_debug_implementations)] pub enum ObjectVariant { Basic(Box), Resolvable(Box), diff --git a/crates/torii/graphql/src/object/model.rs b/crates/torii/graphql/src/object/model.rs index 78428d2f67..c12cf070d4 100644 --- a/crates/torii/graphql/src/object/model.rs +++ b/crates/torii/graphql/src/object/model.rs @@ -18,6 +18,7 @@ use crate::object::resolve_one; const ORDER_BY_NAME: &str = "NAME"; const ORDER_BY_HASH: &str = "CLASS_HASH"; +#[derive(Debug)] pub struct ModelObject; impl BasicObject for ModelObject { diff --git a/crates/torii/graphql/src/object/model_data.rs b/crates/torii/graphql/src/object/model_data.rs index 8a5c555652..f51541a9d0 100644 --- a/crates/torii/graphql/src/object/model_data.rs +++ b/crates/torii/graphql/src/object/model_data.rs @@ -32,6 +32,7 @@ pub struct ModelMember { pub created_at: DateTime, } +#[derive(Debug)] pub struct ModelDataObject { pub name: String, pub plural_name: String, diff --git a/crates/torii/graphql/src/object/transaction.rs b/crates/torii/graphql/src/object/transaction.rs index 34fc0583c2..b58b1671f6 100644 --- a/crates/torii/graphql/src/object/transaction.rs +++ b/crates/torii/graphql/src/object/transaction.rs @@ -7,6 +7,7 @@ use crate::constants::{ use crate::mapping::TRANSACTION_MAPPING; use crate::object::{resolve_many, resolve_one}; +#[derive(Debug)] pub struct TransactionObject; impl BasicObject for TransactionObject { diff --git a/crates/torii/grpc/src/client.rs b/crates/torii/grpc/src/client.rs index 7a0fd4a9b8..035922b141 100644 --- a/crates/torii/grpc/src/client.rs +++ b/crates/torii/grpc/src/client.rs @@ -29,6 +29,7 @@ pub enum Error { Schema(#[from] schema::SchemaError), } +#[derive(Debug)] /// A lightweight wrapper around the grpc client. pub struct WorldClient { _world_address: Felt, @@ -186,6 +187,7 @@ type ModelDiffMappedStream = MapOk< Box StateUpdate + Send>, >; +#[derive(Debug)] pub struct ModelDiffsStreaming(ModelDiffMappedStream); impl Stream for ModelDiffsStreaming { @@ -203,6 +205,7 @@ type EntityMappedStream = MapOk< Box Entity + Send>, >; +#[derive(Debug)] pub struct EntityUpdateStreaming(EntityMappedStream); impl Stream for EntityUpdateStreaming { @@ -220,6 +223,7 @@ type EventMappedStream = MapOk< Box Event + Send>, >; +#[derive(Debug)] pub struct EventUpdateStreaming(EventMappedStream); impl Stream for EventUpdateStreaming { diff --git a/crates/torii/grpc/src/server/mod.rs b/crates/torii/grpc/src/server/mod.rs index dc23a1e559..742d7ec9de 100644 --- a/crates/torii/grpc/src/server/mod.rs +++ b/crates/torii/grpc/src/server/mod.rs @@ -54,7 +54,7 @@ pub(crate) static EVENT_MESSAGES_TABLE: &str = "event_messages"; pub(crate) static EVENT_MESSAGES_MODEL_RELATION_TABLE: &str = "event_model"; pub(crate) static EVENT_MESSAGES_ENTITY_RELATION_COLUMN: &str = "event_message_id"; -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct DojoWorld { pool: Pool, world_address: Felt, diff --git a/crates/torii/grpc/src/server/subscriptions/entity.rs b/crates/torii/grpc/src/server/subscriptions/entity.rs index d58c55969e..252c4df755 100644 --- a/crates/torii/grpc/src/server/subscriptions/entity.rs +++ b/crates/torii/grpc/src/server/subscriptions/entity.rs @@ -27,6 +27,7 @@ use crate::types::{EntityKeysClause, PatternMatching}; pub(crate) const LOG_TARGET: &str = "torii::grpc::server::subscriptions::entity"; +#[derive(Debug)] pub struct EntitiesSubscriber { /// Entity ids that the subscriber is interested in keys: Option, @@ -34,7 +35,7 @@ pub struct EntitiesSubscriber { sender: Sender>, } -#[derive(Default)] +#[derive(Debug, Default)] pub struct EntityManager { subscribers: RwLock>, } @@ -63,6 +64,7 @@ impl EntityManager { } #[must_use = "Service does nothing unless polled"] +#[allow(missing_debug_implementations)] pub struct Service { pool: Pool, subs_manager: Arc, diff --git a/crates/torii/grpc/src/server/subscriptions/event.rs b/crates/torii/grpc/src/server/subscriptions/event.rs index 59cba5fedf..a00ddbbbdd 100644 --- a/crates/torii/grpc/src/server/subscriptions/event.rs +++ b/crates/torii/grpc/src/server/subscriptions/event.rs @@ -23,6 +23,7 @@ use crate::types::{KeysClause, PatternMatching}; pub(crate) const LOG_TARGET: &str = "torii::grpc::server::subscriptions::event"; +#[derive(Debug)] pub struct EventSubscriber { /// Event keys that the subscriber is interested in keys: KeysClause, @@ -30,7 +31,7 @@ pub struct EventSubscriber { sender: Sender>, } -#[derive(Default)] +#[derive(Debug, Default)] pub struct EventManager { subscribers: RwLock>, } @@ -59,6 +60,7 @@ impl EventManager { } #[must_use = "Service does nothing unless polled"] +#[allow(missing_debug_implementations)] pub struct Service { subs_manager: Arc, simple_broker: Pin + Send>>, diff --git a/crates/torii/grpc/src/server/subscriptions/event_message.rs b/crates/torii/grpc/src/server/subscriptions/event_message.rs index 9074800dd9..cc1739f0bb 100644 --- a/crates/torii/grpc/src/server/subscriptions/event_message.rs +++ b/crates/torii/grpc/src/server/subscriptions/event_message.rs @@ -26,6 +26,7 @@ use crate::server::map_row_to_entity; use crate::types::{EntityKeysClause, PatternMatching}; pub(crate) const LOG_TARGET: &str = "torii::grpc::server::subscriptions::event_message"; +#[derive(Debug)] pub struct EventMessagesSubscriber { /// Entity keys that the subscriber is interested in keys: Option, @@ -33,7 +34,7 @@ pub struct EventMessagesSubscriber { sender: Sender>, } -#[derive(Default)] +#[derive(Debug, Default)] pub struct EventMessageManager { subscribers: RwLock>, } @@ -62,6 +63,7 @@ impl EventMessageManager { } #[must_use = "Service does nothing unless polled"] +#[allow(missing_debug_implementations)] pub struct Service { pool: Pool, subs_manager: Arc, diff --git a/crates/torii/grpc/src/server/subscriptions/model_diff.rs b/crates/torii/grpc/src/server/subscriptions/model_diff.rs index 7438525f72..ba9ef6b49c 100644 --- a/crates/torii/grpc/src/server/subscriptions/model_diff.rs +++ b/crates/torii/grpc/src/server/subscriptions/model_diff.rs @@ -26,11 +26,13 @@ use crate::types::ModelKeysClause; pub(crate) const LOG_TARGET: &str = "torii::grpc::server::subscriptions::model_diff"; +#[derive(Debug)] pub struct ModelMetadata { pub selector: Felt, pub packed_size: usize, } +#[derive(Debug)] pub struct ModelDiffRequest { pub model: ModelMetadata, pub keys: proto::types::ModelKeysClause, @@ -38,6 +40,7 @@ pub struct ModelDiffRequest { impl ModelDiffRequest {} +#[derive(Debug)] pub struct ModelDiffSubscriber { /// The storage addresses that the subscriber is interested in. storage_addresses: HashSet, @@ -45,7 +48,7 @@ pub struct ModelDiffSubscriber { sender: Sender>, } -#[derive(Default)] +#[derive(Debug, Default)] pub struct StateDiffManager { subscribers: RwLock>, } @@ -105,6 +108,7 @@ type PublishStateUpdateResult = Result<(), SubscriptionError>; type RequestStateUpdateResult = Result; #[must_use = "Service does nothing unless polled"] +#[allow(missing_debug_implementations)] pub struct Service { world_address: Felt, idle_provider: Option

, diff --git a/crates/torii/libp2p/src/client/mod.rs b/crates/torii/libp2p/src/client/mod.rs index 5412c0b9ec..c3aad69c12 100644 --- a/crates/torii/libp2p/src/client/mod.rs +++ b/crates/torii/libp2p/src/client/mod.rs @@ -28,11 +28,13 @@ struct Behaviour { ping: ping::Behaviour, } +#[derive(Debug)] pub struct RelayClient { pub command_sender: CommandSender, pub event_loop: Arc>, } +#[allow(missing_debug_implementations)] pub struct EventLoop { swarm: Swarm, command_receiver: UnboundedReceiver, @@ -145,6 +147,7 @@ impl RelayClient { } } +#[derive(Debug)] pub struct CommandSender { sender: UnboundedSender, } diff --git a/crates/torii/libp2p/src/server/mod.rs b/crates/torii/libp2p/src/server/mod.rs index 9a7c20e148..2d22fbc7ff 100644 --- a/crates/torii/libp2p/src/server/mod.rs +++ b/crates/torii/libp2p/src/server/mod.rs @@ -44,6 +44,7 @@ pub(crate) const LOG_TARGET: &str = "torii::relay::server"; #[derive(NetworkBehaviour)] #[behaviour(out_event = "ServerEvent")] +#[allow(missing_debug_implementations)] pub struct Behaviour { relay: relay::Behaviour, ping: ping::Behaviour, @@ -51,6 +52,7 @@ pub struct Behaviour { gossipsub: gossipsub::Behaviour, } +#[allow(missing_debug_implementations)] pub struct Relay { swarm: Swarm, db: Sql, diff --git a/crates/torii/server/src/proxy.rs b/crates/torii/server/src/proxy.rs index 23539b5d49..30ee956f79 100644 --- a/crates/torii/server/src/proxy.rs +++ b/crates/torii/server/src/proxy.rs @@ -51,6 +51,7 @@ lazy_static::lazy_static! { }; } +#[derive(Debug)] pub struct Proxy { addr: SocketAddr, allowed_origins: Option>, diff --git a/scripts/clippy.sh b/scripts/clippy.sh index 5453b4129e..c3e1a2e3d1 100755 --- a/scripts/clippy.sh +++ b/scripts/clippy.sh @@ -8,7 +8,7 @@ set -x set -o pipefail run_clippy() { - cargo clippy --all-targets "$@" -- -D warnings -D future-incompatible -D nonstandard-style -D rust-2018-idioms -D unused + cargo clippy --all-targets "$@" -- -D warnings -D future-incompatible -D nonstandard-style -D rust-2018-idioms -D unused -D missing-debug-implementations } run_clippy --all-features --workspace --exclude katana --exclude katana-executor