Skip to content

Commit

Permalink
Rename back to ExtendedTransaction for serialization
Browse files Browse the repository at this point in the history
It was accidentally renamed in b5fc35d,
but this `ExtendedTransaction` is actually about the extended
transaction format and has nothing to do with historic transactions.
  • Loading branch information
hrxi authored and jsdanielh committed Jun 13, 2024
1 parent e4c44c2 commit fa4e312
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions primitives/transaction/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ mod serde_derive {

struct TransactionVisitor;
struct BasicTransactionVisitor;
struct HistoricTransactionVisitor;
struct ExtendedTransactionVisitor;

impl serde::Serialize for Transaction {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
Expand Down Expand Up @@ -647,7 +647,7 @@ mod serde_derive {
let (index, tx_variant) = value.variant()?;
match index {
0 => tx_variant.struct_variant(BASIC_FIELDS, BasicTransactionVisitor),
1 => tx_variant.struct_variant(EXTENDED_FIELDS, HistoricTransactionVisitor),
1 => tx_variant.struct_variant(EXTENDED_FIELDS, ExtendedTransactionVisitor),
_ => Err(A::Error::custom("Undefined transaction type")),
}
}
Expand Down Expand Up @@ -741,11 +741,11 @@ mod serde_derive {
}
}

impl<'de> Visitor<'de> for HistoricTransactionVisitor {
impl<'de> Visitor<'de> for ExtendedTransactionVisitor {
type Value = Transaction;

fn expecting(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
write!(f, "an HistoricTransaction")
write!(f, "an ExtendedTransaction")
}

fn visit_seq<A>(self, mut seq: A) -> Result<Transaction, A::Error>
Expand Down

0 comments on commit fa4e312

Please sign in to comment.