Skip to content

Commit

Permalink
Simplify deserialiseFromTextEnvelopeCddlAnyOf
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Oct 28, 2023
1 parent 9c8ffe3 commit c8ed7de
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cardano-api/internal/Cardano/Api/SerialiseLedgerCddl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,9 @@ deserialiseFromTextEnvelopeCddlAnyOf types teCddl =

Just (FromCDDLWitness ttoken f) -> do
AnyCardanoEra era <- cddlTypeToEra ttoken
case cardanoEraStyle era of
LegacyByronEra -> Left TextEnvelopeCddlErrByronKeyWitnessUnsupported
ShelleyBasedEra sbe ->
f . InAnyCardanoEra era <$> deserialiseWitnessLedgerCddl sbe teCddl
forEraInEon era
(Left TextEnvelopeCddlErrByronKeyWitnessUnsupported)
(\sbe -> f . InAnyCardanoEra era <$> deserialiseWitnessLedgerCddl sbe teCddl)
where
actualType :: Text
actualType = teCddlType teCddl
Expand Down

0 comments on commit c8ed7de

Please sign in to comment.