Skip to content

Commit

Permalink
Update cabal-fmt, cabal-plan, fourmolu (#1659)
Browse files Browse the repository at this point in the history
In preparation for ghc 9.10
  • Loading branch information
locallycompact authored Sep 30, 2024
2 parents b87a47f + 4e4d9ed commit c93142f
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 49 deletions.
6 changes: 3 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@
# Specific versions of tools we require
(final: prev: {
apply-refact = pkgs.haskell-nix.tool compiler "apply-refact" "0.14.0.0";
cabal-fmt = pkgs.haskell-nix.tool compiler "cabal-fmt" "0.1.9";
cabal-fmt = pkgs.haskell-nix.tool compiler "cabal-fmt" "0.1.12";
cabal-install = pkgs.haskell-nix.cabal-install.${compiler};
cabal-plan = pkgs.haskell-nix.tool compiler "cabal-plan" "0.7.3.0";
fourmolu = pkgs.haskell-nix.tool compiler "fourmolu" "0.14.1.0";
cabal-plan = pkgs.haskell-nix.tool compiler "cabal-plan" "0.7.4.0";
fourmolu = pkgs.haskell-nix.tool compiler "fourmolu" "0.16.2.0";
haskell-language-server = pkgs.haskell-nix.tool compiler "haskell-language-server" rec {
src = inputs.hls;
cabalProject = builtins.readFile (src + "/cabal.project");
Expand Down
13 changes: 8 additions & 5 deletions hydra-cluster/hydra-cluster.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ library
build-depends:
, aeson
, async
, base >=4.7 && <5
, base >=4.7 && <5
, bytestring
, cardano-slotting
, containers
Expand All @@ -98,7 +98,8 @@ library
, hydra-node
, hydra-prelude
, hydra-test-utils
, hydra-tx:{hydra-tx, testlib}
, hydra-tx
, hydra-tx:testlib
, io-classes
, iohk-monitoring
, lens
Expand Down Expand Up @@ -157,7 +158,7 @@ test-suite tests
build-depends:
, aeson
, async
, base >=4.7 && <5
, base >=4.7 && <5
, bytestring
, cardano-ledger-api
, containers
Expand All @@ -170,10 +171,12 @@ test-suite tests
, hydra-cardano-api
, hydra-cluster
, hydra-explorer
, hydra-node:{hydra-node, testlib}
, hydra-node
, hydra-node:testlib
, hydra-prelude
, hydra-test-utils
, hydra-tx:{hydra-tx, testlib}
, hydra-tx
, hydra-tx:testlib
, io-classes
, lens
, lens-aeson
Expand Down
6 changes: 3 additions & 3 deletions hydra-cluster/src/HydraNode.hs
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,9 @@ withHydraNode' tracer chainConfig workDir hydraNodeId hydraSKey hydraVKeys allNo

peers =
[ Host
{ Network.hostname = "127.0.0.1"
, Network.port = fromIntegral $ 5_000 + i
}
{ Network.hostname = "127.0.0.1"
, Network.port = fromIntegral $ 5_000 + i
}
| i <- allNodeIds
, i /= hydraNodeId
]
Expand Down
46 changes: 28 additions & 18 deletions hydra-node/hydra-node.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ library
, cardano-crypto-class
, cardano-ledger-alonzo
, cardano-ledger-api
, cardano-ledger-babbage:{cardano-ledger-babbage, testlib}
, cardano-ledger-babbage
, cardano-ledger-babbage:testlib
, cardano-ledger-conway:testlib
, cardano-ledger-core:{cardano-ledger-core, testlib}
, cardano-ledger-core
, cardano-ledger-core:testlib
, cardano-ledger-shelley
, cardano-slotting
, cardano-strict-containers
Expand All @@ -125,8 +127,9 @@ library
, hydra-plutus
, hydra-plutus-extras
, hydra-prelude
, hydra-tx:{hydra-tx, testlib}
, io-classes >=0.3.0.0
, hydra-tx
, hydra-tx:testlib
, io-classes >=0.3.0.0
, iohk-monitoring
, iproute
, lens
Expand All @@ -137,10 +140,10 @@ library
, optparse-applicative
, ouroboros-consensus
, ouroboros-consensus-cardano
, ouroboros-network-api >=0.7.1
, ouroboros-network-api >=0.7.1
, ouroboros-network-framework
, ouroboros-network-protocols >=0.8
, plutus-ledger-api >=1.21
, ouroboros-network-protocols >=0.8
, plutus-ledger-api >=1.21
, prometheus
, QuickCheck
, quickcheck-arbitrary-adt
Expand All @@ -150,8 +153,8 @@ library
, text
, time
, transformers
, typed-protocols >=0.1.0.0
, typed-protocols-cborg >=0.1.0.0
, typed-protocols >=0.1.0.0
, typed-protocols-cborg >=0.1.0.0
, unliftio
, vector
, wai
Expand Down Expand Up @@ -239,7 +242,8 @@ benchmark tx-cost
, hydra-plutus
, hydra-plutus-extras
, hydra-prelude
, hydra-tx:{hydra-tx, testlib}
, hydra-tx
, hydra-tx:testlib
, optparse-applicative
, plutus-ledger-api
, plutus-tx
Expand All @@ -257,7 +261,8 @@ benchmark micro
, base
, criterion
, hydra-cardano-api
, hydra-node:{hydra-node, testlib}
, hydra-node
, hydra-node:testlib
, hydra-prelude
, hydra-tx
, QuickCheck
Expand Down Expand Up @@ -323,10 +328,12 @@ test-suite tests
, cardano-crypto-class
, cardano-ledger-alonzo
, cardano-ledger-api
, cardano-ledger-babbage:{cardano-ledger-babbage, testlib}
, cardano-ledger-babbage
, cardano-ledger-babbage:testlib
, cardano-ledger-conway
, cardano-ledger-core
, cardano-ledger-shelley:{cardano-ledger-shelley, testlib}
, cardano-ledger-shelley
, cardano-ledger-shelley:testlib
, cardano-slotting
, cardano-strict-containers
, cborg
Expand All @@ -340,20 +347,23 @@ test-suite tests
, hspec-wai
, HUnit
, hydra-cardano-api
, hydra-node:{hydra-node, testlib}
, hydra-node
, hydra-node:testlib
, hydra-plutus
, hydra-prelude
, hydra-test-utils
, hydra-tx:{hydra-tx, testlib}
, hydra-tx
, hydra-tx:testlib
, io-classes
, io-sim
, lens
, lens-aeson
, network-simple-wss
, plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} >=1.1.1.0
, plutus-ledger-api >=1.1.1.0
, plutus-ledger-api:plutus-ledger-api-testlib
, plutus-tx
, QuickCheck
, quickcheck-dynamic >=3.4 && <3.5
, quickcheck-dynamic >=3.4 && <3.5
, quickcheck-instances
, random
, regex-tdfa
Expand All @@ -363,7 +373,7 @@ test-suite tests
, text
, time
, tls
, typed-protocols-examples >=0.1.0.0
, typed-protocols-examples >=0.1.0.0
, vector
, websockets

Expand Down
16 changes: 8 additions & 8 deletions hydra-node/src/Hydra/Ledger/Cardano.hs
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ mkSimpleTx (txin, TxOut owner valueIn datum refScript) (recipient, valueOut) sk
outs =
TxOut @CtxTx recipient valueOut TxOutDatumNone ReferenceScriptNone
: [ TxOut @CtxTx
owner
(valueIn <> negateValue valueOut)
(toTxContext datum)
refScript
owner
(valueIn <> negateValue valueOut)
(toTxContext datum)
refScript
| valueOut /= valueIn
]

Expand All @@ -159,10 +159,10 @@ mkRangedTx (txin, TxOut owner valueIn datum refScript) (recipient, valueOut) sk
, txOuts =
TxOut @CtxTx recipient valueOut TxOutDatumNone ReferenceScriptNone
: [ TxOut @CtxTx
owner
(valueIn <> negateValue valueOut)
(toTxContext datum)
refScript
owner
(valueIn <> negateValue valueOut)
(toTxContext datum)
refScript
| valueOut /= valueIn
]
, txFee = TxFeeExplicit $ Coin 0
Expand Down
8 changes: 4 additions & 4 deletions hydra-tui/src/Hydra/TUI/Drawing.hs
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ drawUTxO f utxo =
$ UTxO.toMap utxo
in vBox
[ padTop (Pad 1) $
vBox
[ f addr
, padLeft (Pad 2) $ vBox (str . toString . UTxO.render <$> u)
]
vBox
[ f addr
, padLeft (Pad 2) $ vBox (str . toString . UTxO.render <$> u)
]
| (addr, u) <- Map.toList byAddress
]
9 changes: 6 additions & 3 deletions hydra-tx/hydra-tx.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ library testlib
, cardano-crypto-class
, cardano-ledger-alonzo
, cardano-ledger-api
, cardano-ledger-conway:{cardano-ledger-conway, testlib}
, cardano-ledger-conway
, cardano-ledger-conway:testlib
, cardano-ledger-core
, cardano-ledger-mary
, cardano-ledger-shelley
Expand Down Expand Up @@ -188,9 +189,11 @@ test-suite tests
, hydra-plutus-extras
, hydra-prelude
, hydra-test-utils
, hydra-tx:{hydra-tx, testlib}
, hydra-tx
, hydra-tx:testlib
, lens
, plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib}
, plutus-ledger-api
, plutus-ledger-api:plutus-ledger-api-testlib
, plutus-tx
, QuickCheck
, quickcheck-instances
Expand Down
3 changes: 1 addition & 2 deletions hydra-tx/test/Hydra/Tx/Contract/Contest/ContestCurrent.hs
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,7 @@ genContestMutation (tx, _utxo) =
-- `must not push contestation deadline`.
vectorOf
(length healthyOnChainParties)
( partyFromVerificationKeyBytes <$> genHash
)
(partyFromVerificationKeyBytes <$> genHash)
`suchThat` (/= healthyOnChainParties)
pure $ ChangeOutput 0 $ modifyInlineDatum (replaceParties mutatedParties) headTxOut
, SomeMutation (pure $ toErrorCode ChangedParameters) MutateHeadIdInOutput <$> do
Expand Down
3 changes: 2 additions & 1 deletion hydra-tx/testlib/Test/Hydra/Tx/Mutation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ propTransactionFailsPhase2 mExpectedError (tx, lookupUTxO) =
-- to the 'genericCoverTable' function to construct and display a coverage
-- table showing the percentage of each mutation that's been applied and
-- ensure significant coverage of all possible mutations using 'checkCoverage'.
data SomeMutation = forall lbl.
data SomeMutation
= forall lbl.
(Typeable lbl, Enum lbl, Bounded lbl, Show lbl) =>
SomeMutation
{ expectedErrors :: [Text]
Expand Down
3 changes: 1 addition & 2 deletions plutus-cbor/test/Plutus/Codec/CBOR/EncodingSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ propCompareWithOracle ::
x ->
Property
propCompareWithOracle encodeOracle encodeOurs x =
( Plutus.toBuiltin (CBOR.toStrictByteString oracle) === ours
)
(Plutus.toBuiltin (CBOR.toStrictByteString oracle) === ours)
& counterexample ("value: " <> show x)
& counterexample ("\n─── cborg: \n" <> CBOR.prettyHexEnc oracle)
& counterexample ("\n─── ours: \n" <> decodeUtf8 (Base16.encode (Plutus.fromBuiltin ours)))
Expand Down

0 comments on commit c93142f

Please sign in to comment.