Skip to content

Commit

Permalink
Remove V1 versus V2 distinction for simple scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Mar 16, 2023
1 parent b686592 commit 7b81e07
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/wallet/src/Cardano/Wallet/Shelley/Transaction.hs
Expand Up @@ -772,28 +772,28 @@ updateSealedTx (Cardano.Tx body existingKeyWits) extraContent = do
toLedgerScript walletScript = \case
ShelleyBasedEraShelley ->
Cardano.toShelleyScript $ Cardano.ScriptInEra
Cardano.SimpleScriptV1InShelley
(Cardano.SimpleScript Cardano.SimpleScriptV1 $
Cardano.SimpleScriptInShelley
(Cardano.SimpleScript Cardano.SimpleScript $
toCardanoSimpleScriptV1 walletScript)
ShelleyBasedEraAllegra ->
Cardano.toShelleyScript $ Cardano.ScriptInEra
Cardano.SimpleScriptV2InAllegra
(Cardano.SimpleScript Cardano.SimpleScriptV2 $
Cardano.SimpleScriptInAllegra
(Cardano.SimpleScript Cardano.SimpleScript $
toCardanoSimpleScript walletScript)
ShelleyBasedEraMary ->
Cardano.toShelleyScript $ Cardano.ScriptInEra
Cardano.SimpleScriptV2InMary
(Cardano.SimpleScript Cardano.SimpleScriptV2 $
Cardano.SimpleScriptInMary
(Cardano.SimpleScript Cardano.SimpleScript $
toCardanoSimpleScript walletScript)
ShelleyBasedEraAlonzo ->
Cardano.toShelleyScript $ Cardano.ScriptInEra
Cardano.SimpleScriptV2InAlonzo
(Cardano.SimpleScript Cardano.SimpleScriptV2 $
Cardano.SimpleScriptInAlonzo
(Cardano.SimpleScript Cardano.SimpleScript $
toCardanoSimpleScript walletScript)
ShelleyBasedEraBabbage ->
Cardano.toShelleyScript $ Cardano.ScriptInEra
Cardano.SimpleScriptV2InBabbage
(Cardano.SimpleScript Cardano.SimpleScriptV2 $
Cardano.SimpleScriptInBabbage
(Cardano.SimpleScript Cardano.SimpleScript $
toCardanoSimpleScript walletScript)

-- NOTE: If the ShelleyMA MAClass were exposed, the Allegra and Mary
Expand Down Expand Up @@ -2507,21 +2507,21 @@ mkUnsignedTx era ttl cs md wdrls certs fees mintData burnData mintingScripts inp
ShelleyBasedEraBabbage -> Just Cardano.MultiAssetInBabbageEra

scriptWitsSupported
:: Cardano.ScriptLanguageInEra Cardano.SimpleScriptV2 era
:: Cardano.ScriptLanguageInEra Cardano.SimpleScript era
scriptWitsSupported = case era of
ShelleyBasedEraShelley -> internalError
"scriptWitsSupported: we should be at least in Mary"
ShelleyBasedEraAllegra -> internalError
"scriptWitsSupported: we should be at least in Mary"
ShelleyBasedEraMary -> Cardano.SimpleScriptV2InMary
ShelleyBasedEraAlonzo -> Cardano.SimpleScriptV2InAlonzo
ShelleyBasedEraBabbage -> Cardano.SimpleScriptV2InBabbage
ShelleyBasedEraMary -> Cardano.SimpleScriptInMary
ShelleyBasedEraAlonzo -> Cardano.SimpleScriptInAlonzo
ShelleyBasedEraBabbage -> Cardano.SimpleScriptInBabbage

toScriptWitness :: Script KeyHash -> Cardano.ScriptWitness witctx era
toScriptWitness script =
Cardano.SimpleScriptWitness
scriptWitsSupported
Cardano.SimpleScriptV2
Cardano.SimpleScript
(Cardano.SScript $ toCardanoSimpleScript script)

constructInpScriptWit inp =
Expand Down

0 comments on commit 7b81e07

Please sign in to comment.