diff --git a/crates/starknet-types-rpc/src/custom/query.rs b/crates/starknet-types-rpc/src/custom/query.rs index 841ffb6..1d0bd47 100644 --- a/crates/starknet-types-rpc/src/custom/query.rs +++ b/crates/starknet-types-rpc/src/custom/query.rs @@ -7,7 +7,7 @@ use crate::{ BroadcastedDeclareTxnV1, BroadcastedDeclareTxnV2, DeployAccountTxnV1, InvokeTxnV0, InvokeTxnV1, }; -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(tag = "version")] pub enum BroadcastedDeclareTxn { #[serde(rename = "0x1")] @@ -22,7 +22,7 @@ pub enum BroadcastedDeclareTxn { QueryV2(BroadcastedDeclareTxnV2), } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(tag = "version")] pub enum BroadcastedDeployAccountTxn { #[serde(rename = "0x1")] @@ -32,7 +32,7 @@ pub enum BroadcastedDeployAccountTxn { QueryV1(DeployAccountTxnV1), } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(tag = "version")] pub enum BroadcastedInvokeTxn { #[serde(rename = "0x0")] diff --git a/crates/starknet-types-rpc/src/v0_7_1/starknet_api_openrpc.rs b/crates/starknet-types-rpc/src/v0_7_1/starknet_api_openrpc.rs index aa945eb..2037c98 100644 --- a/crates/starknet-types-rpc/src/v0_7_1/starknet_api_openrpc.rs +++ b/crates/starknet-types-rpc/src/v0_7_1/starknet_api_openrpc.rs @@ -18,13 +18,13 @@ use serde::{Deserialize, Serialize}; pub type Address = F; -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct TransactionAndReceipt { pub receipt: TxnReceipt, pub transaction: Txn, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct TxnWithHash { #[serde(flatten)] pub transaction: Txn, @@ -33,7 +33,7 @@ pub struct TxnWithHash { pub type BlockHash = F; -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct BlockHeader { pub block_hash: BlockHash, /// The block number (its height) @@ -82,7 +82,7 @@ pub enum BlockTag { } /// The block object -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct BlockWithReceipts { /// The transactions in this block pub transactions: Vec>, @@ -92,7 +92,7 @@ pub struct BlockWithReceipts { } /// The block object -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct BlockWithTxs { /// The transactions in this block pub transactions: Vec>, @@ -102,7 +102,7 @@ pub struct BlockWithTxs { } /// The block object -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct BlockWithTxHashes { /// The hashes of the transactions included in this block pub transactions: Vec>, @@ -111,7 +111,7 @@ pub struct BlockWithTxHashes { pub block_header: BlockHeader, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct BroadcastedDeclareTxnV1 { /// The class to be declared pub contract_class: DeprecatedContractClass, @@ -123,7 +123,7 @@ pub struct BroadcastedDeclareTxnV1 { pub signature: Signature, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct BroadcastedDeclareTxnV2 { /// The hash of the Cairo assembly resulting from the Sierra compilation pub compiled_class_hash: F, @@ -137,7 +137,7 @@ pub struct BroadcastedDeclareTxnV2 { pub signature: Signature, } -#[derive(Serialize, Deserialize, Clone, Debug)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(tag = "type")] pub enum BroadcastedTxn { #[serde(rename = "INVOKE")] @@ -151,7 +151,7 @@ pub enum BroadcastedTxn { /// StarkNet chain id, given in hex representation. pub type ChainId = u64; -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct CommonReceiptProperties { /// The fee that was charged by the sequencer pub actual_fee: FeePayment, @@ -168,7 +168,7 @@ pub struct CommonReceiptProperties { pub anon: Anonymous, } -#[derive(Serialize, Deserialize, Clone, Debug)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum Anonymous { /// Common properties for a transaction receipt that was executed successfully @@ -178,14 +178,14 @@ pub enum Anonymous { } /// Common properties for a transaction receipt that was executed successfully -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct SuccessfulCommonReceiptProperties { /// The execution status of the transaction pub execution_status: String, /* SUCCEEDED */ } /// Common properties for a transaction receipt that was reverted -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct RevertedCommonReceiptProperties { /// The execution status of the transaction pub execution_status: String, /* REVERTED */ @@ -194,7 +194,7 @@ pub struct RevertedCommonReceiptProperties { } /// The resources consumed by the VM -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct ComputationResources { /// the number of BITWISE builtin instances #[serde(default)] @@ -229,7 +229,7 @@ pub struct ComputationResources { pub type ContractAbi = Vec; -#[derive(Serialize, Deserialize, Clone, Debug)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum ContractAbiEntry { Function(FunctionAbiEntry), @@ -237,7 +237,7 @@ pub enum ContractAbiEntry { Struct(StructAbiEntry), } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct ContractClass { /// The class ABI, as supplied by the user declaring the class #[serde(default)] @@ -249,7 +249,7 @@ pub struct ContractClass { pub sierra_program: Vec, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct EntryPointsByType { #[serde(rename = "CONSTRUCTOR")] pub constructor: Vec>, @@ -259,7 +259,7 @@ pub struct EntryPointsByType { pub l1_handler: Vec>, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct ContractStorageDiffItem { /// The contract address for which the storage changed pub address: F, @@ -267,7 +267,7 @@ pub struct ContractStorageDiffItem { pub storage_entries: Vec>, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct KeyValuePair { /// The key of the changed value #[serde(default)] @@ -284,7 +284,7 @@ pub enum DaMode { L2, } -#[derive(Serialize, Deserialize, Clone, Debug)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(tag = "version")] pub enum DeclareTxn { #[serde(rename = "0x0")] @@ -297,13 +297,13 @@ pub enum DeclareTxn { V3(DeclareTxnV3), } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DeclareTxnReceipt { #[serde(flatten)] pub common_receipt_properties: CommonReceiptProperties, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DeclareTxnV0 { /// The hash of the declared class pub class_hash: F, @@ -314,7 +314,7 @@ pub struct DeclareTxnV0 { pub signature: Signature, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DeclareTxnV1 { /// The hash of the declared class pub class_hash: F, @@ -326,7 +326,7 @@ pub struct DeclareTxnV1 { pub signature: Signature, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DeclareTxnV2 { /// The hash of the declared class pub class_hash: F, @@ -340,7 +340,7 @@ pub struct DeclareTxnV2 { pub signature: Signature, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DeclareTxnV3 { /// data needed to deploy the account contract from which this tx will be initiated pub account_deployment_data: Vec, @@ -364,7 +364,7 @@ pub struct DeclareTxnV3 { pub tip: U64, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DeployedContractItem { /// The address of the contract pub address: F, @@ -373,7 +373,7 @@ pub struct DeployedContractItem { } /// deploys a new account contract -#[derive(Serialize, Deserialize, Clone, Debug)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(tag = "version")] pub enum DeployAccountTxn { #[serde(rename = "0x1")] @@ -382,7 +382,7 @@ pub enum DeployAccountTxn { V3(DeployAccountTxnV3), } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DeployAccountTxnReceipt { #[serde(flatten)] pub common_receipt_properties: CommonReceiptProperties, @@ -391,7 +391,7 @@ pub struct DeployAccountTxnReceipt { } /// Deploys an account contract, charges fee from the pre-funded account addresses -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DeployAccountTxnV1 { /// The hash of the deployed contract's class pub class_hash: F, @@ -406,7 +406,7 @@ pub struct DeployAccountTxnV1 { } /// Deploys an account contract, charges fee from the pre-funded account addresses -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DeployAccountTxnV3 { /// The hash of the deployed contract's class pub class_hash: F, @@ -428,7 +428,7 @@ pub struct DeployAccountTxnV3 { pub tip: U64, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DeployTxn { /// The hash of the deployed contract's class pub class_hash: F, @@ -440,7 +440,7 @@ pub struct DeployTxn { pub version: F, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DeployTxnReceipt { #[serde(flatten)] pub common_receipt_properties: CommonReceiptProperties, @@ -448,7 +448,7 @@ pub struct DeployTxnReceipt { pub contract_address: F, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DeprecatedCairoEntryPoint { /// The offset of the entry point in the program #[serde(with = "NumAsHex")] @@ -458,7 +458,7 @@ pub struct DeprecatedCairoEntryPoint { } /// The definition of a StarkNet contract class -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DeprecatedContractClass { #[serde(default)] pub abi: Option, @@ -467,7 +467,7 @@ pub struct DeprecatedContractClass { pub program: String, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DeprecatedEntryPointsByType { #[serde(default)] #[serde(rename = "CONSTRUCTOR")] @@ -481,7 +481,7 @@ pub struct DeprecatedEntryPointsByType { } /// Event information decorated with metadata on where it was emitted / An event emitted as a result of transaction execution -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct EmittedEvent { /// The event information #[serde(flatten)] @@ -500,14 +500,14 @@ pub struct EmittedEvent { pub type EthAddress = String; /// A StarkNet event -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct Event { pub from_address: Address, pub data: Vec, pub keys: Vec, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct EventsChunk { /// Use this token in a subsequent query to obtain the next page. Should not appear if there are no more pages. #[serde(default)] @@ -515,7 +515,7 @@ pub struct EventsChunk { pub events: Vec>, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct EventAbiEntry { pub data: Vec, pub keys: Vec, @@ -528,7 +528,7 @@ pub struct EventAbiEntry { pub type EventAbiType = String; /// the resources consumed by the transaction, includes both computation and data -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct ExecutionResources { /// the number of BITWISE builtin instances #[serde(default)] @@ -562,7 +562,7 @@ pub struct ExecutionResources { pub data_availability: DataAvailability, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DataAvailability { /// the data gas consumed by this transaction's data, 0 if it uses gas for DA pub l1_data_gas: u64, @@ -570,7 +570,7 @@ pub struct DataAvailability { pub l1_gas: u64, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct FeeEstimate { /// The Ethereum data gas consumption of the transaction pub data_gas_consumed: F, @@ -587,7 +587,7 @@ pub struct FeeEstimate { } /// fee payment info as it appears in receipts -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct FeePayment { /// amount paid pub amount: F, @@ -595,7 +595,7 @@ pub struct FeePayment { pub unit: PriceUnit, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct FunctionAbiEntry { pub inputs: Vec, /// The function name @@ -619,7 +619,7 @@ pub enum FunctionAbiType { } /// Function call information -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct FunctionCall { /// The parameters passed to the function pub calldata: Vec, @@ -630,7 +630,7 @@ pub struct FunctionCall { pub type FunctionStateMutability = String; /// Initiate a transaction from an account -#[derive(Serialize, Deserialize, Clone, Debug)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(tag = "version")] pub enum InvokeTxn { #[serde(rename = "0x0")] @@ -641,14 +641,14 @@ pub enum InvokeTxn { V3(InvokeTxnV3), } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct InvokeTxnReceipt { #[serde(flatten)] pub common_receipt_properties: CommonReceiptProperties, } /// invokes a specific function in the desired contract (not necessarily an account) -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct InvokeTxnV0 { /// The parameters passed to the function pub calldata: Vec, @@ -659,7 +659,7 @@ pub struct InvokeTxnV0 { pub signature: Signature, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct InvokeTxnV1 { /// The data expected by the account's `execute` function (in most usecases, this includes the called contract address and a function selector) pub calldata: Vec, @@ -670,7 +670,7 @@ pub struct InvokeTxnV1 { pub signature: Signature, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct InvokeTxnV3 { /// data needed to deploy the account contract from which this tx will be initiated pub account_deployment_data: Vec, @@ -691,7 +691,7 @@ pub struct InvokeTxnV3 { pub tip: U64, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct L1HandlerTxn { /// The L1->L2 message nonce field of the SN Core L1 contract at the time the transaction was sent #[serde(with = "NumAsHex")] @@ -703,7 +703,7 @@ pub struct L1HandlerTxn { } /// receipt for l1 handler transaction -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct L1HandlerTxnReceipt { /// The message hash as it appears on the L1 core contract #[serde(with = "NumAsHex")] @@ -712,7 +712,7 @@ pub struct L1HandlerTxnReceipt { pub common_receipt_properties: CommonReceiptProperties, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct MsgFromL1 { /// The selector of the l1_handler in invoke in the target contract pub entry_point_selector: F, @@ -724,7 +724,7 @@ pub struct MsgFromL1 { pub to_address: Address, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct MsgToL1 { /// The address of the L2 contract sending the message pub from_address: F, @@ -734,7 +734,7 @@ pub struct MsgToL1 { pub to_address: F, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct PendingBlockHeader { /// specifies whether the data of this block is published via blob data or calldata pub l1_da_mode: L1DaMode, @@ -762,7 +762,7 @@ pub enum L1DaMode { } /// The dynamic block being constructed by the sequencer. Note that this object will be deprecated upon decentralization. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct PendingBlockWithReceipts { /// The transactions in this block pub transactions: Vec>, @@ -771,7 +771,7 @@ pub struct PendingBlockWithReceipts { } /// The dynamic block being constructed by the sequencer. Note that this object will be deprecated upon decentralization. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct PendingBlockWithTxs { /// The transactions in this block pub transactions: Vec>, @@ -780,7 +780,7 @@ pub struct PendingBlockWithTxs { } /// The dynamic block being constructed by the sequencer. Note that this object will be deprecated upon decentralization. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct PendingBlockWithTxHashes { /// The hashes of the transactions included in this block pub transactions: Vec>, @@ -789,7 +789,7 @@ pub struct PendingBlockWithTxHashes { } /// Pending state update -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct PendingStateUpdate { /// The previous global state root pub old_root: F, @@ -804,7 +804,7 @@ pub enum PriceUnit { Wei, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct ResourceBounds { /// the max amount of the resource that can be used in the tx pub max_amount: U64, @@ -812,7 +812,7 @@ pub struct ResourceBounds { pub max_price_per_unit: U128, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct ResourceBoundsMapping { /// The max amount and max price per unit of L1 gas used in this tx pub l1_gas: ResourceBounds, @@ -820,7 +820,7 @@ pub struct ResourceBoundsMapping { pub l2_gas: ResourceBounds, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct ResourcePrice { /// the price of one unit of the given resource, denominated in fri (10^-18 strk) pub price_in_fri: F, @@ -828,7 +828,7 @@ pub struct ResourcePrice { pub price_in_wei: F, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct SierraEntryPoint { /// The index of the function in the program pub function_idx: u64, @@ -843,7 +843,7 @@ pub type Signature = Vec; pub type SimulationFlagForEstimateFee = String; /// The change in state applied in this block, given as a mapping of addresses to the new values and/or new contracts -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct StateDiff { pub declared_classes: Vec>, pub deployed_contracts: Vec>, @@ -854,7 +854,7 @@ pub struct StateDiff { } /// The declared class hash and compiled class hash -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct NewClasses { /// The hash of the declared class #[serde(default)] @@ -865,7 +865,7 @@ pub struct NewClasses { } /// The updated nonce per contract address -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct NonceUpdate { /// The address of the contract #[serde(default)] @@ -876,7 +876,7 @@ pub struct NonceUpdate { } /// The list of contracts whose class was replaced -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct ReplacedClass { /// The new class hash #[serde(default)] @@ -886,7 +886,7 @@ pub struct ReplacedClass { pub contract_address: Option>, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct StateUpdate { pub block_hash: BlockHash, /// The new global state root @@ -899,7 +899,7 @@ pub struct StateUpdate { /// A storage key. Represented as up to 62 hex digits, 3 bits, and 5 leading zeroes. pub type StorageKey = String; -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct StructAbiEntry { pub members: Vec, /// The struct name @@ -911,7 +911,7 @@ pub struct StructAbiEntry { pub type StructAbiType = String; -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct StructMember { #[serde(flatten)] pub typed_parameter: TypedParameter, @@ -921,7 +921,7 @@ pub struct StructMember { } /// An object describing the node synchronization status -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct SyncStatus { /// The hash of the current block being synchronized pub current_block_hash: BlockHash, @@ -938,7 +938,7 @@ pub struct SyncStatus { } /// The transaction schema, as it appears inside a block -#[derive(Serialize, Deserialize, Clone, Debug)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(tag = "type")] pub enum Txn { #[serde(rename = "INVOKE")] @@ -975,7 +975,7 @@ pub enum TxnFinalityStatus { // pub type TxnHash Deserialize<'de>> = F; pub type TxnHash = F; -#[derive(Serialize, Deserialize, Clone, Debug)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(tag = "type")] pub enum TxnReceipt { #[serde(rename = "INVOKE")] @@ -990,7 +990,7 @@ pub enum TxnReceipt { DeployAccount(DeployAccountTxnReceipt), } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct TxnReceiptWithBlockInfo { #[serde(flatten)] pub transaction_receipt: TxnReceipt, @@ -1015,7 +1015,7 @@ pub enum TxnStatus { Rejected, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct TypedParameter { /// The parameter's name pub name: String, @@ -1030,41 +1030,41 @@ pub type U128 = String; /// 64 bit integers, represented by hex string of length at most 16 pub type U64 = String; -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct BlockHashAndNumber { pub block_hash: BlockHash, pub block_number: BlockNumber, } -#[derive(Serialize, Deserialize, Clone, Debug)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum StarknetGetBlockWithTxsAndReceiptsResult { Block(BlockWithReceipts), Pending(PendingBlockWithReceipts), } -#[derive(Serialize, Deserialize, Clone, Debug)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum MaybePendingBlockWithTxHashes { Block(BlockWithTxHashes), Pending(PendingBlockWithTxHashes), } -#[derive(Serialize, Deserialize, Clone, Debug)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum MaybePendingBlockWithTxs { Block(BlockWithTxs), Pending(PendingBlockWithTxs), } -#[derive(Serialize, Deserialize, Clone, Debug)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum MaybeDeprecatedContractClass { Deprecated(DeprecatedContractClass), ContractClass(ContractClass), } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct EventFilterWithPageRequest { #[serde(default)] pub address: Option>, @@ -1081,14 +1081,14 @@ pub struct EventFilterWithPageRequest { pub continuation_token: Option, } -#[derive(Serialize, Deserialize, Clone, Debug)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum MaybePendingStateUpdate { Block(StateUpdate), Pending(PendingStateUpdate), } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct TxnFinalityAndExecutionStatus { #[serde(default)] pub execution_status: Option, diff --git a/crates/starknet-types-rpc/src/v0_7_1/starknet_trace_api_openrpc.rs b/crates/starknet-types-rpc/src/v0_7_1/starknet_trace_api_openrpc.rs index dae4b4b..5a79789 100644 --- a/crates/starknet-types-rpc/src/v0_7_1/starknet_trace_api_openrpc.rs +++ b/crates/starknet-types-rpc/src/v0_7_1/starknet_trace_api_openrpc.rs @@ -37,7 +37,7 @@ pub enum EntryPointType { L1Handler, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct FunctionInvocation { #[serde(flatten)] pub function_call: FunctionCall, @@ -62,7 +62,7 @@ pub struct FunctionInvocation { pub type NestedCall = FunctionInvocation; /// an event alongside its order within the transaction -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct OrderedEvent { /// the order of the event within the transaction #[serde(default)] @@ -72,7 +72,7 @@ pub struct OrderedEvent { } /// a message alongside its order within the transaction -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct OrderedMessage { /// the order of the message within the transaction #[serde(default)] @@ -90,7 +90,7 @@ pub enum SimulationFlag { Validate, } -#[derive(Serialize, Deserialize, Clone, Debug)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(tag = "type")] pub enum TransactionTrace { /// the execution trace of an invoke transaction @@ -108,7 +108,7 @@ pub enum TransactionTrace { } /// the execution trace of an invoke transaction -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct InvokeTransactionTrace { /// the trace of the __execute__ call or constructor call, depending on the transaction type (none for declare transactions) pub execute_invocation: ExecuteInvocation, @@ -124,21 +124,21 @@ pub struct InvokeTransactionTrace { } /// the trace of the __execute__ call or constructor call, depending on the transaction type (none for declare transactions) -#[derive(Serialize, Deserialize, Clone, Debug)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum ExecuteInvocation { FunctionInvocation(FunctionInvocation), Anon(RevertedInvocation), } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct RevertedInvocation { /// the revert reason for the failed execution pub revert_reason: String, } /// the execution trace of a declare transaction -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DeclareTransactionTrace { /// the resources consumed by the transaction, includes both computation and data pub execution_resources: ExecutionResources, @@ -152,7 +152,7 @@ pub struct DeclareTransactionTrace { } /// the execution trace of a deploy account transaction -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct DeployAccountTransactionTrace { /// the trace of the __execute__ call or constructor call, depending on the transaction type (none for declare transactions) pub constructor_invocation: FunctionInvocation, @@ -168,7 +168,7 @@ pub struct DeployAccountTransactionTrace { } /// the execution trace of an L1 handler transaction -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct L1HandlerTransactionTrace { /// the resources consumed by the transaction, includes both computation and data pub execution_resources: ExecutionResources, @@ -179,7 +179,7 @@ pub struct L1HandlerTransactionTrace { pub state_diff: Option>, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct SimulateTransactionsResult { #[serde(default)] pub fee_estimation: Option>, @@ -188,7 +188,7 @@ pub struct SimulateTransactionsResult { } /// A single pair of transaction hash and corresponding trace -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct TraceBlockTransactionsResult { #[serde(default)] pub trace_root: Option>, diff --git a/crates/starknet-types-rpc/src/v0_7_1/starknet_write_api.rs b/crates/starknet-types-rpc/src/v0_7_1/starknet_write_api.rs index 3c57fa4..fc58636 100644 --- a/crates/starknet-types-rpc/src/v0_7_1/starknet_write_api.rs +++ b/crates/starknet-types-rpc/src/v0_7_1/starknet_write_api.rs @@ -15,19 +15,19 @@ use core::marker::PhantomData; use serde::ser::SerializeMap; use serde::{Deserialize, Serialize}; -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct ClassAndTxnHash { pub class_hash: F, pub transaction_hash: TxnHash, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct ContractAndTxnHash { pub contract_address: Felt, pub transaction_hash: TxnHash, } -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct AddInvokeTransactionResult { pub transaction_hash: TxnHash, }