From 28e22ad74c16423e646a0706e7b035a63f79fbd2 Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Tue, 25 Feb 2025 04:13:07 -0500 Subject: [PATCH] feat: derive Clone for trie rpc types --- crates/katana/rpc/rpc-types/src/trie.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/katana/rpc/rpc-types/src/trie.rs b/crates/katana/rpc/rpc-types/src/trie.rs index 00d310efb6..b5c1d8e97e 100644 --- a/crates/katana/rpc/rpc-types/src/trie.rs +++ b/crates/katana/rpc/rpc-types/src/trie.rs @@ -15,7 +15,7 @@ pub struct ContractStorageKeys { pub keys: Vec, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct GlobalRoots { /// The associated block hash (needed in case the caller used a block tag for the block_id /// parameter). @@ -68,7 +68,7 @@ impl MerkleNode { /// The requested storage proofs. Note that if a requested leaf has the default value, the path to /// it may end in an edge node whose path is not a prefix of the requested leaf, thus effectively /// proving non-membership -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct GetStorageProofResponse { pub global_roots: GlobalRoots, pub classes_proof: ClassesProof, @@ -76,13 +76,13 @@ pub struct GetStorageProofResponse { pub contracts_storage_proofs: ContractStorageProofs, } -#[derive(Debug, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(transparent)] pub struct ClassesProof { pub nodes: Nodes, } -#[derive(Debug, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] pub struct ContractsProof { /// The nodes in the union of the paths from the contracts tree root to the requested leaves. pub nodes: Nodes, @@ -91,7 +91,7 @@ pub struct ContractsProof { pub contract_leaves_data: Vec, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ContractLeafData { // NOTE: This field is not specified in the RPC specs, but the contract storage root is // required to compute the contract state hash (ie the value of the contracts trie). We @@ -101,19 +101,19 @@ pub struct ContractLeafData { pub class_hash: Felt, } -#[derive(Debug, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(transparent)] pub struct ContractStorageProofs { pub nodes: Vec, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct NodeWithHash { pub node_hash: Felt, pub node: MerkleNode, } -#[derive(Debug, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(transparent)] pub struct Nodes(pub Vec);