Skip to content

Commit 9e2568e

Browse files
committed
Hack: tweak deserialisation preference to make integration tests pass
1 parent d17d047 commit 9e2568e

File tree

1 file changed

+18
-2
lines changed
  • lib/core/src/Cardano/Wallet/Primitive/Types

1 file changed

+18
-2
lines changed

lib/core/src/Cardano/Wallet/Primitive/Types/Tx.hs

+18-2
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,24 @@ cardanoTxFromBytes
607607
-> ByteString -- ^ Serialised transaction
608608
-> Either DecoderError (InAnyCardanoEra Cardano.Tx)
609609
cardanoTxFromBytes maxEra bs = asum $ map snd $ filter (withinEra maxEra . fst)
610-
[ deserialise BabbageEra Cardano.AsBabbageEra
611-
, deserialise AlonzoEra Cardano.AsAlonzoEra
610+
-- NOTE: Attempting to deserialise in Alonzo before Babbage is intentional.
611+
--
612+
-- It seems Alonzo transactions can be deserialized as Babbage
613+
-- transactions. This causes new-tx workflow integration tests to fail.
614+
-- The txs are interpreted as Babbage txs right before submitting them to
615+
-- the Alonzo-era ledger.
616+
--
617+
-- This may also cause problems with our store of pending txs.
618+
--
619+
-- TODO: Can we come up with a better solution?
620+
-- - Using Alonzo txs once we're in Babbage doesn't sound good?
621+
-- - Ideally we should set @maxEra == currentNodeEra@ argument.
622+
-- - But we can't access currentNodeEra from PersistField instances
623+
-- - It might be good to ensure txs in the DB also store which era they
624+
-- correspond to.
625+
[ deserialise AlonzoEra Cardano.AsAlonzoEra
626+
, deserialise BabbageEra Cardano.AsBabbageEra
627+
612628
, deserialise MaryEra Cardano.AsMaryEra
613629
, deserialise AllegraEra Cardano.AsAllegraEra
614630
, deserialise ShelleyEra Cardano.AsShelleyEra

0 commit comments

Comments
 (0)