From 7f0e022f1d0b322c9b631c27091527d9ff04e26c Mon Sep 17 00:00:00 2001 From: Santiago Carmuega Date: Sun, 28 Jan 2024 16:26:23 -0300 Subject: [PATCH] fix: favor Babbage over Conway for tx decoding (#389) --- pallas-traverse/src/tx.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pallas-traverse/src/tx.rs b/pallas-traverse/src/tx.rs index c3998c4..129b8a9 100644 --- a/pallas-traverse/src/tx.rs +++ b/pallas-traverse/src/tx.rs @@ -64,13 +64,17 @@ impl<'b> MultiEraTx<'b> { /// Try decode a transaction via every era's encoding format, starting with /// the most recent and returning on first success, or None if none are /// successful + /// + /// NOTE: Until Conway is officially released, this method favors Babbage + /// decoding over Conway decoding. This means that we'll attempt to + /// decode using Babbage first even if Conway is newer. pub fn decode(cbor: &'b [u8]) -> Result { if let Ok(tx) = minicbor::decode(cbor) { - return Ok(MultiEraTx::Conway(Box::new(Cow::Owned(tx)))); + return Ok(MultiEraTx::Babbage(Box::new(Cow::Owned(tx)))); } if let Ok(tx) = minicbor::decode(cbor) { - return Ok(MultiEraTx::Babbage(Box::new(Cow::Owned(tx)))); + return Ok(MultiEraTx::Conway(Box::new(Cow::Owned(tx)))); } if let Ok(tx) = minicbor::decode(cbor) {