Skip to content

DONOTMERGE: Add check-tx-upgrade executable - #2151

Draft
jasagredo wants to merge 3 commits into
mainfrom
js/tx-upgrade-check
Draft

DONOTMERGE: Add check-tx-upgrade executable#2151
jasagredo wants to merge 3 commits into
mainfrom
js/tx-upgrade-check

WIP

3ccd55d
Select commit
Loading
Failed to load commit list.
IOG Hydra / ci/hydra-build:x86_64-linux.native.formattingLinting.fourmolu failed Jul 30, 2026 in 9s

Build failed

1 failed steps

Details

Failed Steps

Step 1

Derivation

/nix/store/34firy1rjxs0ihwldr1cb2bk3q40ms7q-check-fourmolu-exe-fourmolu.drv

Log

unpacking source archive /nix/store/lqj6s3hw4i8vribm6m1w878zjzsp0ly5-x1mrqfr0aqcsslwjhi63sz5zp78jk82w-source
source root is x1mrqfr0aqcsslwjhi63sz5zp78jk82w-source
The custom options for formatting this repo are:
fourmolu 0.20.0.0
using ghc-lib-parser 9.14.1.20251220
> indentation: 2
> column-limit: 100
> import-export-style: leading
> haddock-style: single-line
> single-constraint-parens: never
> single-deriving-parens: never
> import-grouping: single

Formatting haskell files...
Loaded config from: fourmolu.yaml
diff -ru /nix/store/lqj6s3hw4i8vribm6m1w878zjzsp0ly5-x1mrqfr0aqcsslwjhi63sz5zp78jk82w-source/ouroboros-consensus-cardano/app/check-tx-upgrade.hs ./ouroboros-consensus-cardano/app/check-tx-upgrade.hs
--- /nix/store/lqj6s3hw4i8vribm6m1w878zjzsp0ly5-x1mrqfr0aqcsslwjhi63sz5zp78jk82w-source/ouroboros-consensus-cardano/app/check-tx-upgrade.hs     1970-01-01 00:00:01.000000000 +0000
+++ ./ouroboros-consensus-cardano/app/check-tx-upgrade.hs       2026-07-30 09:53:13.600421144 +0000
@@ -42,7 +42,7 @@
 import Cardano.Ledger.TxIn (TxIn (..))
 import Control.Monad (when)
 import Control.Monad.Except (runExcept)
-import Data.SOP.BasicFunctors ((:.:) (Comp), unComp)
+import Data.SOP.BasicFunctors (unComp, (:.:) (Comp))
 import qualified Data.Set as Set
 import Lens.Micro ((&), (.~))
 import Ouroboros.Consensus.HardFork.Combinator.InjectTxs
@@ -95,32 +95,33 @@
 
 main :: IO ()
 main = do
-  let -- A single synthetic input, reusing the id of a basic empty tx.
-      dummyInput :: TxIn
-      dummyInput =
-        TxIn
-          (SL.txIdTx (SL.mkBasicTx SL.mkBasicTxBody :: SL.Tx SL.TopTx BabbageEra))
-          (TxIx 0)
-
-      babbageGenTx :: GenTx StandardBabbageBlock
-      babbageGenTx = mkShelleyTx (mkTxWithInput dummyInput)
-
-      conwayNativeGenTx :: GenTx StandardConwayBlock
-      conwayNativeGenTx = mkShelleyTx (mkTxWithInput dummyInput)
-
-      -- A minimal (empty) body, for comparison. Note this still contains the
-      -- always-present (here empty) inputs set, so it does not isolate set
-      -- encoding; it shows the Babbage and Conway body encoders differ even at
-      -- their smallest.
-      emptyBabbageId = case mkShelleyTx (SL.mkBasicTx SL.mkBasicTxBody) :: GenTx StandardBabbageBlock of
-        ShelleyTx i _ -> i
-      emptyConwayId = case mkShelleyTx (SL.mkBasicTx SL.mkBasicTxBody) :: GenTx StandardConwayBlock of
-        ShelleyTx i _ -> i
-
-      -- Never forced by the transaction-level translation (see the haddock on
-      -- 'babbageToConwayInjection').
-      conwayCtxt :: SL.TranslationContext ConwayEra
-      conwayCtxt = undefined
+  let
+    -- A single synthetic input, reusing the id of a basic empty tx.
+    dummyInput :: TxIn
+    dummyInput =
+      TxIn
+        (SL.txIdTx (SL.mkBasicTx SL.mkBasicTxBody :: SL.Tx SL.TopTx BabbageEra))
+        (TxIx 0)
+
+    babbageGenTx :: GenTx StandardBabbageBlock
+    babbageGenTx = mkShelleyTx (mkTxWithInput dummyInput)
+
+    conwayNativeGenTx :: GenTx StandardConwayBlock
+    conwayNativeGenTx = mkShelleyTx (mkTxWithInput dummyInput)
+
+    -- A minimal (empty) body, for comparison. Note this still contains the
+    -- always-present (here empty) inputs set, so it does not isolate set
+    -- encoding; it shows the Babbage and Conway body encoders differ even at
+    -- their smallest.
+    emptyBabbageId = case mkShelleyTx (SL.mkBasicTx SL.mkBasicTxBody) :: GenTx StandardBabbageBlock of
+      ShelleyTx i _ -> i
+    emptyConwayId = case mkShelleyTx (SL.mkBasicTx SL.mkBasicTxBody) :: GenTx StandardConwayBlock of
+      ShelleyTx i _ -> i
+
+    -- Never forced by the transaction-level translation (see the haddock on
+    -- 'babbageToConwayInjection').
+    conwayCtxt :: SL.TranslationContext ConwayEra
+    conwayCtxt = undefined
 
   case injectTxWith (babbageToConwayInjection conwayCtxt) babbageGenTx of
     Nothing -> do
@@ -142,7 +143,8 @@
       putStrLn ""
       putStrLn $ "  upgrade preserves tx id (1 == 2)          : " ++ show (babbageId == upgradedId)
       putStrLn $ "  upgraded == native Conway (2 == 3)        : " ++ show (upgradedId == nativeId)
-      putStrLn $ "  empty body id agrees across eras          : " ++ show (emptyBabbageId == emptyConwayId)
+      putStrLn $
+        "  empty body id agrees across eras          : " ++ show (emptyBabbageId == emptyConwayId)
       putStrLn ""
       if babbageId /= upgradedId
         then
*** fourmolu-exe-fourmolu-0.20.0.0 found changes that need addressed first