Skip to content

Commit

Permalink
Fix TxWitness text envelope formatting for the Shelley era
Browse files Browse the repository at this point in the history
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: #4493
  • Loading branch information
Jimbo4350 committed Oct 5, 2022
1 parent 188fc31 commit 2cd5ab7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cardano-api/src/Cardano/Api/Tx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/Shelley/Run/Transaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1763,7 +1763,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
Expand Down

0 comments on commit 2cd5ab7

Please sign in to comment.