Skip to content

Commit

Permalink
feat: serialize BlockHashAndNumber's new attributes to match RPC (#1620)
Browse files Browse the repository at this point in the history
  • Loading branch information
guy-starkware authored Nov 5, 2024
1 parent f9843c4 commit 413515b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/papyrus_rpc/resources/V0_8/starknet_api_openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -736,18 +736,18 @@
"title": "Starknet block hash and number result",
"type": "object",
"properties": {
"hash": {
"block_hash": {
"title": "Block hash",
"$ref": "#/components/schemas/BLOCK_HASH"
},
"number": {
"block_number": {
"title": "Block number",
"$ref": "#/components/schemas/BLOCK_NUMBER"
}
},
"required": [
"hash",
"number"
"block_hash",
"block_number"
]
}
},
Expand Down
2 changes: 2 additions & 0 deletions crates/starknet_api/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ impl BlockNumber {
/// [BlockNumber](`crate::block::BlockNumber`).
#[derive(Copy, Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
pub struct BlockHashAndNumber {
#[serde(rename = "block_hash")]
pub hash: BlockHash,
#[serde(rename = "block_number")]
pub number: BlockNumber,
}

Expand Down

0 comments on commit 413515b

Please sign in to comment.