Skip to content

Commit 185833c

Browse files
RomarQsorpaas
authored andcommitted
Fix(fc-rpc-v2-api): Make mix_hash optional and handle camelCase fields in Transaction (polkadot-evm#1724)
* fix: handle camelCase fields in Transaction and make mix_hash field optional for rpc-v2 * Update client/rpc-v2/types/src/transaction/mod.rs Co-authored-by: Wei Tang <[email protected]> --------- Co-authored-by: Wei Tang <[email protected]>
1 parent e5b6a15 commit 185833c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

client/rpc-v2/types/src/block.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ pub struct Header {
8585
#[serde(skip_serializing_if = "Option::is_none")]
8686
pub total_difficulty: Option<U256>,
8787
/// Mix hash.
88-
pub mix_hash: H256,
88+
#[serde(default, skip_serializing_if = "Option::is_none")]
89+
pub mix_hash: Option<H256>,
8990

9091
/// Base fee per unit of gas, which is added by [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559).
9192
#[serde(default, skip_serializing_if = "Option::is_none")]

client/rpc-v2/types/src/transaction/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ impl<'de> serde::Deserialize<'de> for TxType {
8181
}
8282

8383
#[derive(Clone, Debug, Eq, PartialEq, Default, Serialize, Deserialize)]
84+
#[serde(rename_all = "camelCase")]
8485
pub struct Transaction {
85-
/// [EIP-2718](https://eips.ethereum.org/EIPS/eip-27 gg ) transaction type
86+
/// [EIP-2718](https://eips.ethereum.org/EIPS/eip-2718) transaction type
8687
#[serde(rename = "type")]
8788
pub tx_type: TxType,
8889

0 commit comments

Comments
 (0)