Skip to content

Commit

Permalink
fix v0.13.4 gateway deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
cchudant committed Mar 6, 2025
1 parent 00b432d commit d8db06b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Next release

- fix(gateway-client): fix v0.13.4 gateway deserialization
- chore: Merge entire madara-orchestrator project into this one
- fix(primitives): limit legacy class sizes
- fix(block_production): dynamic block closing now adds special address with prev block hash
Expand Down
19 changes: 9 additions & 10 deletions madara/crates/primitives/gateway/src/block.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
use super::{
receipt::{ConfirmedReceipt, MsgToL2},
transaction::Transaction,
};
use anyhow::Context;
use mp_block::header::{BlockTimestamp, L1DataAvailabilityMode};
use mp_chain_config::StarknetVersion;
Expand All @@ -6,11 +10,6 @@ use serde::{Deserialize, Serialize};
use serde_with::serde_as;
use starknet_types_core::felt::Felt;

use super::{
receipt::{ConfirmedReceipt, MsgToL2},
transaction::Transaction,
};

#[derive(Debug, Clone, PartialEq, Serialize)] // no Deserialize because it's untagged
#[serde(untagged)]
#[allow(clippy::large_enum_variant)]
Expand Down Expand Up @@ -57,7 +56,7 @@ impl ProviderBlockPendingMaybe {
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
// #[serde(deny_unknown_fields)] // TODO(v0.13.4): Re-add this attribute when v0.13.4 is supported.
#[cfg_attr(test, derive(Eq))]
pub struct ProviderBlock {
pub block_hash: Felt,
Expand Down Expand Up @@ -170,7 +169,7 @@ impl ProviderBlock {
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
// #[serde(deny_unknown_fields)] // TODO(v0.13.4): Re-add this attribute when v0.13.4 is supported.
#[cfg_attr(test, derive(Eq))]
pub struct ProviderBlockPending {
pub parent_block_hash: Felt,
Expand Down Expand Up @@ -250,7 +249,7 @@ impl ProviderBlockPending {
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
// #[serde(deny_unknown_fields)] // TODO(v0.13.4): Re-add this attribute when v0.13.4 is supported.
#[cfg_attr(test, derive(Eq))]
pub struct ProviderBlockSignature {
pub block_hash: Felt,
Expand All @@ -259,7 +258,7 @@ pub struct ProviderBlockSignature {

#[serde_as]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
// #[serde(deny_unknown_fields)] // TODO(v0.13.4): Re-add this attribute when v0.13.4 is supported.
#[cfg_attr(test, derive(Eq))]
pub struct ResourcePrice {
#[serde_as(as = "U128AsHex")]
Expand All @@ -270,7 +269,7 @@ pub struct ResourcePrice {

#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[serde(deny_unknown_fields)]
// #[serde(deny_unknown_fields)] // TODO(v0.13.4): Re-add this attribute when v0.13.4 is supported.
pub enum BlockStatus {
Pending,
Aborted,
Expand Down

0 comments on commit d8db06b

Please sign in to comment.