Skip to content

Commit

Permalink
Fix the order in which scripts from AuxData are serialized
Browse files Browse the repository at this point in the history
  • Loading branch information
lehins committed Nov 29, 2022
1 parent b265d7f commit 9506b3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Data.hs
Expand Up @@ -287,11 +287,11 @@ instance
getTimelock _ = Nothing
getPlutus (PlutusScript _ x) = Just x
getPlutus _ = Nothing
sortScripts (ts, v1, v2) s@(TimelockScript _) = (s : ts, v1, v2)
sortScripts (ts, v1, v2) s@(PlutusScript PlutusV1 _) = (ts, s : v1, v2)
sortScripts (ts, v1, v2) s@(PlutusScript PlutusV2 _) = (ts, v1, s : v2)
sortScripts s@(TimelockScript _) (ts, v1, v2) = (s : ts, v1, v2)
sortScripts s@(PlutusScript PlutusV1 _) (ts, v1, v2) = (ts, s : v1, v2)
sortScripts s@(PlutusScript PlutusV2 _) (ts, v1, v2) = (ts, v1, s : v2)
(timelocks, plutusV1Scripts, plutusV2Scripts) =
foldl' sortScripts (mempty, mempty, mempty) allScripts
foldr sortScripts (mempty, mempty, mempty) allScripts

instance
( Era era,
Expand Down

0 comments on commit 9506b3d

Please sign in to comment.