Skip to content

Commit

Permalink
add PartialEq, Eq to a few more structs
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejka committed Jul 3, 2024
1 parent 0f42c0b commit 11e26aa
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 54 deletions.
2 changes: 1 addition & 1 deletion crates/starknet-types-rpc/src/v0_7_1/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! v0.6.0 of the API.
//! v0.7.1 of the API.

pub use starknet_types_core::felt::Felt;

Expand Down
55 changes: 24 additions & 31 deletions crates/starknet-types-rpc/src/v0_7_1/starknet_api_openrpc.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
//
// This file was automatically generated by openrpc-gen.
//
// Do not edit it manually and instead edit either the source OpenRPC document,
// the configuration file, or open an issue or pull request on the openrpc-gen
// GitHub repository.
//
// https://github.com/nils-mathieu/openrpc-gen
//
// This file was automatically generated by openrpc-gen first, then manually edited.

use super::{BlockId, BroadcastedDeclareTxn, BroadcastedDeployAccountTxn, BroadcastedInvokeTxn};
use crate::custom_serde::NumAsHex;
Expand Down Expand Up @@ -1096,7 +1089,7 @@ pub struct TxnFinalityAndExecutionStatus {
}

/// Parameters of the `starknet_specVersion` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct SpecVersionParams {}

impl Serialize for SpecVersionParams {
Expand Down Expand Up @@ -1159,7 +1152,7 @@ impl<'de> Deserialize<'de> for SpecVersionParams {
}

/// Parameters of the `starknet_getBlockWithTxHashes` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct GetBlockWithTxHashesParams<F> {
/// The hash of the requested block, or number (height) of the requested block, or a block tag
pub block_id: BlockId<F>,
Expand Down Expand Up @@ -1238,7 +1231,7 @@ impl<'de, F: Serialize + Deserialize<'de>> Deserialize<'de> for GetBlockWithTxHa
}

/// Parameters of the `starknet_getBlockWithTxs` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct GetBlockWithTxsParams<F> {
/// The hash of the requested block, or number (height) of the requested block, or a block tag
pub block_id: BlockId<F>,
Expand Down Expand Up @@ -1317,7 +1310,7 @@ impl<'de, F: Copy + Serialize + Deserialize<'de>> Deserialize<'de> for GetBlockW
}

/// Parameters of the `starknet_getBlockWithReceipts` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct GetBlockWithReceiptsParams<F> {
/// The hash of the requested block, or number (height) of the requested block, or a block tag
pub block_id: BlockId<F>,
Expand Down Expand Up @@ -1396,7 +1389,7 @@ impl<'de, F: Copy + Deserialize<'de>> Deserialize<'de> for GetBlockWithReceiptsP
}

/// Parameters of the `starknet_getStateUpdate` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct GetStateUpdateParams<F> {
/// The hash of the requested block, or number (height) of the requested block, or a block tag
pub block_id: BlockId<F>,
Expand Down Expand Up @@ -1475,7 +1468,7 @@ impl<'de, F: Copy + Serialize + Deserialize<'de>> Deserialize<'de> for GetStateU
}

/// Parameters of the `starknet_getStorageAt` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct GetStorageAtParams<F> {
/// The address of the contract to read from
pub contract_address: Address<F>,
Expand Down Expand Up @@ -1574,7 +1567,7 @@ impl<'de, F: Copy + Serialize + Deserialize<'de>> Deserialize<'de> for GetStorag
}

/// Parameters of the `starknet_getTransactionStatus` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct GetTransactionStatusParams<F> {
/// The hash of the requested transaction
pub transaction_hash: TxnHash<F>,
Expand Down Expand Up @@ -1634,7 +1627,7 @@ impl<'de, F: Deserialize<'de>> Deserialize<'de> for GetTransactionStatusParams<F
}

/// Parameters of the `starknet_getTransactionByHash` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct GetTransactionByHashParams<F> {
/// The hash of the requested transaction
pub transaction_hash: TxnHash<F>,
Expand Down Expand Up @@ -1694,7 +1687,7 @@ impl<'de, F: Deserialize<'de>> Deserialize<'de> for GetTransactionByHashParams<F
}

/// Parameters of the `starknet_getTransactionByBlockIdAndIndex` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct GetTransactionByBlockIdAndIndexParams<F> {
/// The hash of the requested block, or number (height) of the requested block, or a block tag
pub block_id: BlockId<F>,
Expand Down Expand Up @@ -1786,7 +1779,7 @@ impl<'de, F: Copy + Serialize + Deserialize<'de>> Deserialize<'de>
}

/// Parameters of the `starknet_getTransactionReceipt` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct GetTransactionReceiptParams<F> {
/// The hash of the requested transaction
pub transaction_hash: TxnHash<F>,
Expand Down Expand Up @@ -1846,7 +1839,7 @@ impl<'de, F: Deserialize<'de>> Deserialize<'de> for GetTransactionReceiptParams<
}

/// Parameters of the `starknet_getClass` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct GetClassParams<F> {
/// The hash of the requested block, or number (height) of the requested block, or a block tag
pub block_id: BlockId<F>,
Expand Down Expand Up @@ -1936,7 +1929,7 @@ impl<'de, F: Copy + Serialize + Deserialize<'de>> Deserialize<'de> for GetClassP
}

/// Parameters of the `starknet_getClassHashAt` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct GetClassHashAtParams<F> {
/// The hash of the requested block, or number (height) of the requested block, or a block tag
pub block_id: BlockId<F>,
Expand Down Expand Up @@ -2026,7 +2019,7 @@ impl<'de, F: Copy + Serialize + Deserialize<'de>> Deserialize<'de> for GetClassH
}

/// Parameters of the `starknet_getClassAt` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct GetClassAtParams<F> {
/// The hash of the requested block, or number (height) of the requested block, or a block tag
pub block_id: BlockId<F>,
Expand Down Expand Up @@ -2116,7 +2109,7 @@ impl<'de, F: Copy + Serialize + Deserialize<'de>> Deserialize<'de> for GetClassA
}

/// Parameters of the `starknet_getBlockTransactionCount` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct GetBlockTransactionCountParams<F> {
/// The hash of the requested block, or number (height) of the requested block, or a block tag
pub block_id: BlockId<F>,
Expand Down Expand Up @@ -2197,7 +2190,7 @@ impl<'de, F: Copy + Serialize + Deserialize<'de>> Deserialize<'de>
}

/// Parameters of the `starknet_call` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct CallParams<F> {
/// The details of the function call
pub request: FunctionCall<F>,
Expand Down Expand Up @@ -2284,7 +2277,7 @@ impl<'de, F: Copy + Serialize + Deserialize<'de>> Deserialize<'de> for CallParam
}

/// Parameters of the `starknet_estimateFee` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct EstimateFeeParams<F: Default> {
/// The transaction to estimate
pub request: Vec<BroadcastedTxn<F>>,
Expand Down Expand Up @@ -2385,7 +2378,7 @@ impl<'de, F: Copy + Default + Serialize + Deserialize<'de>> Deserialize<'de>
}

/// Parameters of the `starknet_estimateMessageFee` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct EstimateMessageFeeParams<F> {
/// the message's parameters
pub message: MsgFromL1<F>,
Expand Down Expand Up @@ -2472,7 +2465,7 @@ impl<'de, F: Copy + Serialize + Deserialize<'de>> Deserialize<'de> for EstimateM
}

/// Parameters of the `starknet_blockNumber` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct BlockNumberParams {}

impl Serialize for BlockNumberParams {
Expand Down Expand Up @@ -2535,7 +2528,7 @@ impl<'de> Deserialize<'de> for BlockNumberParams {
}

/// Parameters of the `starknet_blockHashAndNumber` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct BlockHashAndNumberParams {}

impl Serialize for BlockHashAndNumberParams {
Expand Down Expand Up @@ -2598,7 +2591,7 @@ impl<'de> Deserialize<'de> for BlockHashAndNumberParams {
}

/// Parameters of the `starknet_chainId` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct ChainIdParams {}

impl Serialize for ChainIdParams {
Expand Down Expand Up @@ -2661,7 +2654,7 @@ impl<'de> Deserialize<'de> for ChainIdParams {
}

/// Parameters of the `starknet_syncing` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct SyncingParams {}

impl Serialize for SyncingParams {
Expand Down Expand Up @@ -2724,7 +2717,7 @@ impl<'de> Deserialize<'de> for SyncingParams {
}

/// Parameters of the `starknet_getEvents` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct GetEventsParams<F: Copy> {
/// The conditions used to filter the returned events
pub filter: EventFilterWithPageRequest<F>,
Expand Down Expand Up @@ -2803,7 +2796,7 @@ impl<'de, F: Copy + Default + Deserialize<'de>> Deserialize<'de> for GetEventsPa
}

/// Parameters of the `starknet_getNonce` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct GetNonceParams<F> {
/// The hash of the requested block, or number (height) of the requested block, or a block tag
pub block_id: BlockId<F>,
Expand Down
15 changes: 4 additions & 11 deletions crates/starknet-types-rpc/src/v0_7_1/starknet_trace_api_openrpc.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
//
// This file was automatically generated by openrpc-gen.
//
// Do not edit it manually and instead edit either the source OpenRPC document,
// the configuration file, or open an issue or pull request on the openrpc-gen
// GitHub repository.
//
// https://github.com/nils-mathieu/openrpc-gen
//
// This file was automatically generated by openrpc-gen first, then manually edited.

use super::{
BlockId, BroadcastedTxn, ComputationResources, Event, ExecutionResources, FeeEstimate,
Expand Down Expand Up @@ -197,7 +190,7 @@ pub struct TraceBlockTransactionsResult<F: Default> {
}

/// Parameters of the `starknet_traceTransaction` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct TraceTransactionParams<F> {
/// The hash of the transaction to trace
pub transaction_hash: TxnHash<F>,
Expand Down Expand Up @@ -276,7 +269,7 @@ impl<'de, F: Deserialize<'de>> Deserialize<'de> for TraceTransactionParams<F> {
}

/// Parameters of the `starknet_simulateTransactions` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct SimulateTransactionsParams<F: Default> {
/// The hash of the requested block, or number (height) of the requested block, or a block tag, for the block referencing the state or call the transaction on.
pub block_id: BlockId<F>,
Expand Down Expand Up @@ -375,7 +368,7 @@ impl<'de, F: Copy + Default + Deserialize<'de>> Deserialize<'de> for SimulateTra
}

/// Parameters of the `starknet_traceBlockTransactions` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct TraceBlockTransactionsParams<F> {
/// The hash of the requested block, or number (height) of the requested block, or a block tag
pub block_id: BlockId<F>,
Expand Down
15 changes: 4 additions & 11 deletions crates/starknet-types-rpc/src/v0_7_1/starknet_write_api.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
//
// This file was automatically generated by openrpc-gen.
//
// Do not edit it manually and instead edit either the source OpenRPC document,
// the configuration file, or open an issue or pull request on the openrpc-gen
// GitHub repository.
//
// https://github.com/nils-mathieu/openrpc-gen
//
// This file was automatically generated by openrpc-gen first, then manually edited.

use super::{
BroadcastedDeclareTxn, BroadcastedDeployAccountTxn, BroadcastedInvokeTxn, Felt, TxnHash,
Expand All @@ -33,7 +26,7 @@ pub struct AddInvokeTransactionResult<F> {
}

/// Parameters of the `starknet_addInvokeTransaction` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct AddInvokeTransactionParams<F> {
/// The information needed to invoke the function (or account, for version 1 transactions)
pub invoke_transaction: BroadcastedInvokeTxn<F>,
Expand Down Expand Up @@ -112,7 +105,7 @@ impl<'de, F: Deserialize<'de>> Deserialize<'de> for AddInvokeTransactionParams<F
}

/// Parameters of the `starknet_addDeclareTransaction` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct AddDeclareTransactionParams<F: Default> {
/// Declare transaction required to declare a new class on Starknet
pub declare_transaction: BroadcastedDeclareTxn<F>,
Expand Down Expand Up @@ -193,7 +186,7 @@ impl<'de, F: Default + Deserialize<'de>> Deserialize<'de> for AddDeclareTransact
}

/// Parameters of the `starknet_addDeployAccountTransaction` method.
#[derive(Debug, Clone)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct AddDeployAccountTransactionParams<F> {
/// The deploy account transaction
pub deploy_account_transaction: BroadcastedDeployAccountTxn<F>,
Expand Down

0 comments on commit 11e26aa

Please sign in to comment.