Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove option #105

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading