Skip to content

Commit

Permalink
fix: remove option
Browse files Browse the repository at this point in the history
  • Loading branch information
jbcaron committed Dec 4, 2024
1 parent 7ef3023 commit 73e79b2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 36 deletions.
36 changes: 12 additions & 24 deletions crates/starknet-types-rpc/src/v0_7_1/starknet_api_openrpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,9 @@ pub struct ContractStorageDiffItem<F: Default> {
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct KeyValuePair<F> {
/// The key of the changed value
#[serde(default)]
pub key: Option<F>,
pub key: F,
/// The new value applied to the given address
#[serde(default)]
pub value: Option<F>,
pub value: F,
}

/// Specifies a storage domain in Starknet. Each domain has different gurantess regarding availability
Expand Down Expand Up @@ -504,15 +502,12 @@ pub struct DeprecatedContractClass<F: Default> {

#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct DeprecatedEntryPointsByType<F> {
#[serde(default)]
#[serde(rename = "CONSTRUCTOR")]
pub constructor: Option<Vec<DeprecatedCairoEntryPoint<F>>>,
#[serde(default)]
pub constructor: Vec<DeprecatedCairoEntryPoint<F>>,
#[serde(rename = "EXTERNAL")]
pub external: Option<Vec<DeprecatedCairoEntryPoint<F>>>,
#[serde(default)]
pub external: Vec<DeprecatedCairoEntryPoint<F>>,
#[serde(rename = "L1_HANDLER")]
pub l1_handler: Option<Vec<DeprecatedCairoEntryPoint<F>>>,
pub l1_handler: Vec<DeprecatedCairoEntryPoint<F>>,
}

/// Event information decorated with metadata on where it was emitted / An event emitted as a result of transaction execution
Expand Down Expand Up @@ -892,33 +887,27 @@ pub struct StateDiff<F: Default> {
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct NewClasses<F> {
/// The hash of the declared class
#[serde(default)]
pub class_hash: Option<F>,
pub class_hash: F,
/// The Cairo assembly hash corresponding to the declared class
#[serde(default)]
pub compiled_class_hash: Option<F>,
pub compiled_class_hash: F,
}

/// The updated nonce per contract address
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct NonceUpdate<F> {
/// The address of the contract
#[serde(default)]
pub contract_address: Option<Address<F>>,
pub contract_address: Address<F>,
/// The nonce for the given address at the end of the block
#[serde(default)]
pub nonce: Option<F>,
pub nonce: F,
}

/// The list of contracts whose class was replaced
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct ReplacedClass<F> {
/// The new class hash
#[serde(default)]
pub class_hash: Option<F>,
pub class_hash: F,
/// The address of the contract whose class was replaced
#[serde(default)]
pub contract_address: Option<Address<F>>,
pub contract_address: Address<F>,
}

#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
Expand Down Expand Up @@ -951,8 +940,7 @@ pub struct StructMember {
#[serde(flatten)]
pub typed_parameter: TypedParameter,
/// offset of this property within the struct
#[serde(default)]
pub offset: Option<u64>,
pub offset: u64,
}

/// An object describing the node synchronization status
Expand Down
18 changes: 6 additions & 12 deletions crates/starknet-types-rpc/src/v0_7_1/starknet_trace_api_openrpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ pub type NestedCall<F> = FunctionInvocation<F>;
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct OrderedEvent<F> {
/// the order of the event within the transaction
#[serde(default)]
pub order: Option<u64>,
pub order: u64,
#[serde(flatten)]
pub event: Event<F>,
}
Expand All @@ -76,8 +75,7 @@ pub struct OrderedEvent<F> {
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct OrderedMessage<F> {
/// the order of the message within the transaction
#[serde(default)]
pub order: Option<u64>,
pub order: u64,
#[serde(flatten)]
pub msg_to_l_1: MsgToL1<F>,
}
Expand Down Expand Up @@ -182,19 +180,15 @@ pub struct L1HandlerTransactionTrace<F: Default> {

#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct SimulateTransactionsResult<F: Default> {
#[serde(default)]
pub fee_estimation: Option<FeeEstimate<F>>,
#[serde(default)]
pub transaction_trace: Option<TransactionTrace<F>>,
pub fee_estimation: FeeEstimate<F>,
pub transaction_trace: TransactionTrace<F>,
}

/// A single pair of transaction hash and corresponding trace
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct TraceBlockTransactionsResult<F: Default> {
#[serde(default)]
pub trace_root: Option<TransactionTrace<F>>,
#[serde(default)]
pub transaction_hash: Option<F>,
pub trace_root: TransactionTrace<F>,
pub transaction_hash: F,
}

/// Parameters of the `starknet_traceTransaction` method.
Expand Down

0 comments on commit 73e79b2

Please sign in to comment.