From 76beb9a15462e3f61564c1b492af2f1c6b308ee0 Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Mon, 3 Oct 2022 11:31:02 +0200 Subject: [PATCH] Fix TxWitness text envelope formatting for the Shelley era Fix 4493 bug - essentially the type field in the Shelley era text envelope tx body was being written to disk as "TxWitnessShelley" and being read from disk as "TxWitness Shelley". I.e there was a mismatch and therefore it was not possible to read shelley era transaction bodies. Closes: https://github.com/input-output-hk/cardano-node/issues/4493 --- cardano-api/src/Cardano/Api/Tx.hs | 2 +- cardano-cli/src/Cardano/CLI/Shelley/Run/Transaction.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cardano-api/src/Cardano/Api/Tx.hs b/cardano-api/src/Cardano/Api/Tx.hs index 408e1848adc..a55f86f242a 100644 --- a/cardano-api/src/Cardano/Api/Tx.hs +++ b/cardano-api/src/Cardano/Api/Tx.hs @@ -439,7 +439,7 @@ instance IsCardanoEra era => HasTextEnvelope (KeyWitness era) where textEnvelopeType _ = case cardanoEra :: CardanoEra era of ByronEra -> "TxWitnessByron" - ShelleyEra -> "TxWitnessShelley" + ShelleyEra -> "TxWitness ShelleyEra" AllegraEra -> "TxWitness AllegraEra" MaryEra -> "TxWitness MaryEra" AlonzoEra -> "TxWitness AlonzoEra" diff --git a/cardano-cli/src/Cardano/CLI/Shelley/Run/Transaction.hs b/cardano-cli/src/Cardano/CLI/Shelley/Run/Transaction.hs index 27f32a0e28d..49594f6c1c1 100644 --- a/cardano-cli/src/Cardano/CLI/Shelley/Run/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/Shelley/Run/Transaction.hs @@ -1759,7 +1759,7 @@ acceptKeyWitnessCDDLSerialisation err = firstExceptT (ShelleyTxCmdTextEnvCddlError tEnvErr) $ newExceptT $ readFileTextEnvelopeCddlAnyOf teTypes fp - teTypes = [ FromCDDLWitness "TxWitness Shelley" CddlWitness + teTypes = [ FromCDDLWitness "TxWitness ShelleyEra" CddlWitness , FromCDDLWitness "TxWitness AllegraEra" CddlWitness , FromCDDLWitness "TxWitness MaryEra" CddlWitness , FromCDDLWitness "TxWitness AlonzoEra" CddlWitness