diff --git a/src/receipt.rs b/src/receipt.rs index a5026a3..23ab8e6 100644 --- a/src/receipt.rs +++ b/src/receipt.rs @@ -84,7 +84,11 @@ impl EnvelopedDecodable for ReceiptV1 { feature = "with-codec", derive(codec::Encode, codec::Decode, scale_info::TypeInfo) )] -#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr( + feature = "with-serde", + derive(serde::Serialize, serde::Deserialize), + serde(untagged) +)] pub enum ReceiptV2 { /// Legacy receipt type Legacy(EIP658ReceiptData), @@ -147,7 +151,11 @@ impl From for EIP658ReceiptData { feature = "with-codec", derive(codec::Encode, codec::Decode, scale_info::TypeInfo) )] -#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr( + feature = "with-serde", + derive(serde::Serialize, serde::Deserialize), + serde(untagged) +)] pub enum ReceiptV3 { /// Legacy receipt type Legacy(EIP658ReceiptData), @@ -219,7 +227,11 @@ impl From for EIP658ReceiptData { feature = "with-codec", derive(codec::Encode, codec::Decode, scale_info::TypeInfo) )] -#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr( + feature = "with-serde", + derive(serde::Serialize, serde::Deserialize), + serde(untagged) +)] pub enum ReceiptAny { /// Frontier receipt type Frontier(FrontierReceiptData), diff --git a/src/transaction/mod.rs b/src/transaction/mod.rs index 86cd63a..ba9a575 100644 --- a/src/transaction/mod.rs +++ b/src/transaction/mod.rs @@ -40,7 +40,11 @@ impl EnvelopedDecodable for TransactionV0 { feature = "with-codec", derive(codec::Encode, codec::Decode, scale_info::TypeInfo) )] -#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr( + feature = "with-serde", + derive(serde::Serialize, serde::Deserialize), + serde(untagged) +)] pub enum TransactionV1 { /// Legacy transaction type Legacy(LegacyTransaction), @@ -103,7 +107,11 @@ impl EnvelopedDecodable for TransactionV1 { feature = "with-codec", derive(codec::Encode, codec::Decode, scale_info::TypeInfo) )] -#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr( + feature = "with-serde", + derive(serde::Serialize, serde::Deserialize), + serde(untagged) +)] pub enum TransactionV2 { /// Legacy transaction type Legacy(LegacyTransaction),