Skip to content

Commit 5841932

Browse files
committed
fourmolu the whole project with new version
1 parent 5b06bf5 commit 5841932

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1845
-1650
lines changed

cardano-chain-gen/src/Cardano/Mock/Forging/Tx/Conway.hs

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -227,17 +227,17 @@ mkPaymentTx' inputIndex outputIndices fees donation state' = do
227227
NoDatum
228228
SNothing
229229

230-
pure $
231-
mkSimpleTx True $
232-
consPaymentTxBody
233-
inputs
234-
mempty
235-
mempty
236-
(StrictSeq.fromList $ outputs <> [change])
237-
SNothing
238-
(Coin fees)
239-
mempty
240-
(Coin donation)
230+
pure
231+
$ mkSimpleTx True
232+
$ consPaymentTxBody
233+
inputs
234+
mempty
235+
mempty
236+
(StrictSeq.fromList $ outputs <> [change])
237+
SNothing
238+
(Coin fees)
239+
mempty
240+
(Coin donation)
241241
where
242242
mkOutputs (outIx, val) = do
243243
addr <- resolveAddress outIx state'
@@ -268,17 +268,17 @@ mkLockByScriptTx inputIndex txOutTypes amount fees state' = do
268268
NoDatum
269269
SNothing
270270

271-
pure $
272-
mkSimpleTx True $
273-
consPaymentTxBody
274-
inputs
275-
mempty
276-
mempty
277-
(StrictSeq.fromList $ outputs <> [change])
278-
SNothing
279-
(Coin fees)
280-
mempty
281-
(Coin 0)
271+
pure
272+
$ mkSimpleTx True
273+
$ consPaymentTxBody
274+
inputs
275+
mempty
276+
mempty
277+
(StrictSeq.fromList $ outputs <> [change])
278+
SNothing
279+
(Coin fees)
280+
mempty
281+
(Coin 0)
282282

283283
mkUnlockScriptTx ::
284284
[ConwayUTxOIndex] ->
@@ -348,9 +348,9 @@ mkDCertPoolTx consDCert state' = do
348348

349349
mkDCertTxPools :: ConwayLedgerState -> Either ForgingError (AlonzoTx StandardConway)
350350
mkDCertTxPools state' =
351-
Right $
352-
mkSimpleTx True $
353-
consCertTxBody Nothing (allPoolStakeCert' state') (Withdrawals mempty)
351+
Right
352+
$ mkSimpleTx True
353+
$ consCertTxBody Nothing (allPoolStakeCert' state') (Withdrawals mempty)
354354

355355
mkSimpleTx :: Bool -> ConwayTxBody StandardConway -> AlonzoTx StandardConway
356356
mkSimpleTx isValid' txBody =
@@ -394,9 +394,9 @@ mkScriptDCertTx consCert isValid' state' = do
394394
cred <- resolveStakeCreds stakeIndex state'
395395
pure $ mkDCert cred
396396

397-
pure $
398-
mkScriptTx isValid' (mapMaybe prepareRedeemer . zip [0 ..] $ consCert) $
399-
consCertTxBody Nothing dcerts (Withdrawals mempty)
397+
pure
398+
$ mkScriptTx isValid' (mapMaybe prepareRedeemer . zip [0 ..] $ consCert)
399+
$ consCertTxBody Nothing dcerts (Withdrawals mempty)
400400
where
401401
prepareRedeemer (n, (StakeIndexScript bl, shouldAddRedeemer, _))
402402
| not shouldAddRedeemer = Nothing
@@ -428,24 +428,24 @@ mkMultiAssetsScriptTx inputIx colInputIx outputIx refInput minted succeeds fees
428428
refInputs' = Set.fromList $ map (fst . fst) refs
429429
colInputs' = Set.singleton $ fst colInput
430430

431-
pure $
432-
mkScriptTx succeeds (mkScriptInps (map fst inputs) ++ mkScriptMint' minted) $
433-
consTxBody
434-
inputs'
435-
colInputs'
436-
refInputs'
437-
(StrictSeq.fromList outputs)
438-
SNothing
439-
(Coin fees)
440-
mempty
441-
mempty -- TODO[sgillespie]: minted?
442-
(Withdrawals mempty)
443-
(Coin 0)
431+
pure
432+
$ mkScriptTx succeeds (mkScriptInps (map fst inputs) ++ mkScriptMint' minted)
433+
$ consTxBody
434+
inputs'
435+
colInputs'
436+
refInputs'
437+
(StrictSeq.fromList outputs)
438+
SNothing
439+
(Coin fees)
440+
mempty
441+
mempty -- TODO[sgillespie]: minted?
442+
(Withdrawals mempty)
443+
(Coin 0)
444444
where
445445
mkOuts (outIx, val) = do
446446
addr <- resolveAddress outIx state'
447-
pure $
448-
BabbageTxOut
447+
pure
448+
$ BabbageTxOut
449449
addr
450450
val
451451
(DatumHash $ hashData @StandardConway plutusDataList)
@@ -468,19 +468,19 @@ mkDepositTxPools inputIndex deposit state' = do
468468
NoDatum
469469
SNothing
470470

471-
pure $
472-
mkSimpleTx True $
473-
consTxBody
474-
input
475-
mempty
476-
mempty
477-
(StrictSeq.fromList [change])
478-
SNothing
479-
(Coin 0)
480-
mempty
481-
(allPoolStakeCert' state')
482-
(Withdrawals mempty)
483-
(Coin 0)
471+
pure
472+
$ mkSimpleTx True
473+
$ consTxBody
474+
input
475+
mempty
476+
mempty
477+
(StrictSeq.fromList [change])
478+
SNothing
479+
(Coin 0)
480+
mempty
481+
(allPoolStakeCert' state')
482+
(Withdrawals mempty)
483+
(Coin 0)
484484

485485
mkRegisterDRepTx ::
486486
Credential 'DRepRole StandardCrypto ->
@@ -663,8 +663,8 @@ mkFullTx n m state' = do
663663
refInputPairs <- fmap fst <$> mapM (`resolveUTxOIndex` state') refInputs
664664
collateralInput <- Set.singleton . fst . fst <$> resolveUTxOIndex collateralInputs state'
665665

666-
pure $
667-
AlonzoTx
666+
pure
667+
$ AlonzoTx
668668
{ body =
669669
txBody
670670
(mkInputs inputPairs)
@@ -748,8 +748,8 @@ mkFullTx n m state' = do
748748
, ConwayTxCertPool $ Core.RegPool poolParams1
749749
, ConwayTxCertPool $ Core.RetirePool (Prelude.head unregisteredPools) (EpochNo 0)
750750
, ConwayTxCertDeleg $ ConwayUnRegCert (unregisteredStakeCredentials !! 2) SNothing
751-
, ConwayTxCertDeleg $
752-
ConwayDelegCert
751+
, ConwayTxCertDeleg
752+
$ ConwayDelegCert
753753
(unregisteredStakeCredentials !! 1)
754754
(DelegStake $ unregisteredPools !! 2)
755755
]
@@ -766,8 +766,8 @@ mkFullTx n m state' = do
766766

767767
-- Withdrawals
768768
withdrawals =
769-
Withdrawals $
770-
Map.fromList
769+
Withdrawals
770+
$ Map.fromList
771771
[ (RewardAccount Testnet (unregisteredStakeCredentials !! 1), Coin 100)
772772
, (RewardAccount Testnet (unregisteredStakeCredentials !! 1), Coin 100)
773773
]
@@ -899,17 +899,17 @@ mkUnlockScriptTx' inputIndex colInputIndex outputIndex refInput colOut succeeds
899899
NoDatum
900900
SNothing
901901

902-
pure $
903-
mkScriptTx succeeds (mkScriptInps inputPairs) $
904-
consPaymentTxBody
905-
inputs
906-
colInputs
907-
refInputs
908-
(StrictSeq.singleton output)
909-
(maybeToStrictMaybe colOut)
910-
(Coin fees)
911-
mempty
912-
(Coin 0)
902+
pure
903+
$ mkScriptTx succeeds (mkScriptInps inputPairs)
904+
$ consPaymentTxBody
905+
inputs
906+
colInputs
907+
refInputs
908+
(StrictSeq.singleton output)
909+
(maybeToStrictMaybe colOut)
910+
(Coin fees)
911+
mempty
912+
(Coin 0)
913913

914914
allPoolStakeCert' :: ConwayLedgerState -> [ConwayTxCert StandardConway]
915915
allPoolStakeCert' st = map (mkRegTxCert SNothing) (getCreds st)

cardano-chain-gen/src/Cardano/Mock/Forging/Tx/Conway/Scenarios.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ forgeBlocksChunked interpreter vs f = forM (chunksOf 500 vs) $ \blockCreds -> do
9797
registerDRepsAndDelegateVotes :: Interpreter -> IO CardanoBlock
9898
registerDRepsAndDelegateVotes interpreter = do
9999
blockTxs <-
100-
withConwayLedgerState interpreter $
101-
registerDRepAndDelegateVotes'
100+
withConwayLedgerState interpreter
101+
$ registerDRepAndDelegateVotes'
102102
(Prelude.head unregisteredDRepIds)
103103
(StakeIndex 4)
104104

cardano-chain-gen/src/Cardano/Mock/Query.hs

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ queryDRepDistrAmount drepHash epochNo = do
9898
(distr :& hash) <-
9999
from
100100
$ table @Db.DrepDistr
101-
`innerJoin` table @Db.DrepHash
102-
`on` (\(distr :& hash) -> (hash ^. Db.DrepHashId) ==. (distr ^. Db.DrepDistrHashId))
101+
`innerJoin` table @Db.DrepHash
102+
`on` (\(distr :& hash) -> (hash ^. Db.DrepHashId) ==. (distr ^. Db.DrepDistrHashId))
103103

104104
where_ $ hash ^. Db.DrepHashRaw ==. just (val drepHash)
105105
where_ $ distr ^. Db.DrepDistrEpochNo ==. val epochNo
@@ -140,14 +140,14 @@ queryConstitutionAnchor epochNo = do
140140
(_ :& anchor :& epochState) <-
141141
from
142142
$ table @Db.Constitution
143-
`innerJoin` table @Db.VotingAnchor
144-
`on` ( \(constit :& anchor) ->
145-
(constit ^. Db.ConstitutionVotingAnchorId) ==. (anchor ^. Db.VotingAnchorId)
146-
)
147-
`innerJoin` table @Db.EpochState
148-
`on` ( \(constit :& _ :& epoch) ->
149-
just (constit ^. Db.ConstitutionId) ==. (epoch ^. Db.EpochStateConstitutionId)
150-
)
143+
`innerJoin` table @Db.VotingAnchor
144+
`on` ( \(constit :& anchor) ->
145+
(constit ^. Db.ConstitutionVotingAnchorId) ==. (anchor ^. Db.VotingAnchorId)
146+
)
147+
`innerJoin` table @Db.EpochState
148+
`on` ( \(constit :& _ :& epoch) ->
149+
just (constit ^. Db.ConstitutionId) ==. (epoch ^. Db.EpochStateConstitutionId)
150+
)
151151

152152
where_ (epochState ^. Db.EpochStateEpochNo ==. val epochNo)
153153

@@ -193,11 +193,13 @@ queryVoteCounts txHash idx = do
193193
(vote :& tx) <-
194194
from
195195
$ table @Db.VotingProcedure
196-
`innerJoin` table @Db.Tx
197-
`on` (\(vote :& tx) -> vote ^. Db.VotingProcedureTxId ==. tx ^. Db.TxId)
198-
where_ $
199-
vote ^. Db.VotingProcedureVote ==. val v
200-
&&. tx ^. Db.TxHash ==. val txHash
201-
&&. vote ^. Db.VotingProcedureIndex ==. val idx
196+
`innerJoin` table @Db.Tx
197+
`on` (\(vote :& tx) -> vote ^. Db.VotingProcedureTxId ==. tx ^. Db.TxId)
198+
where_
199+
$ vote
200+
^. Db.VotingProcedureVote
201+
==. val v
202+
&&. tx ^. Db.TxHash ==. val txHash
203+
&&. vote ^. Db.VotingProcedureIndex ==. val idx
202204
pure countRows
203205
pure (maybe 0 unValue res)

cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Conway/CommandLineArg/EpochDisabled.hs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ checkEpochDisabledArg =
2424
-- Forge some blocks
2525
void $ forgeAndSubmitBlocks interpreter mockServer 50
2626
-- Add two blocks with transactions
27-
void $
28-
withConwayFindLeaderAndSubmitTx interpreter mockServer $
29-
Conway.mkPaymentTx (UTxOIndex 0) (UTxOIndex 1) 10_000 10_000 0
30-
void $
31-
withConwayFindLeaderAndSubmitTx interpreter mockServer $
32-
Conway.mkPaymentTx (UTxOIndex 1) (UTxOIndex 0) 10_000 10_000 0
27+
void
28+
$ withConwayFindLeaderAndSubmitTx interpreter mockServer
29+
$ Conway.mkPaymentTx (UTxOIndex 0) (UTxOIndex 1) 10_000 10_000 0
30+
void
31+
$ withConwayFindLeaderAndSubmitTx interpreter mockServer
32+
$ Conway.mkPaymentTx (UTxOIndex 1) (UTxOIndex 0) 10_000 10_000 0
3333
-- Add some more empty blocks
3434
void $ forgeAndSubmitBlocks interpreter mockServer 60
3535

@@ -48,12 +48,12 @@ checkEpochEnabled =
4848
-- Forge some blocks
4949
void $ forgeAndSubmitBlocks interpreter mockServer 50
5050
-- Add two blocks with transactions
51-
void $
52-
withConwayFindLeaderAndSubmitTx interpreter mockServer $
53-
Conway.mkPaymentTx (UTxOIndex 0) (UTxOIndex 1) 10_000 10_000 0
54-
void $
55-
withConwayFindLeaderAndSubmitTx interpreter mockServer $
56-
Conway.mkPaymentTx (UTxOIndex 1) (UTxOIndex 0) 10_000 10_000 0
51+
void
52+
$ withConwayFindLeaderAndSubmitTx interpreter mockServer
53+
$ Conway.mkPaymentTx (UTxOIndex 0) (UTxOIndex 1) 10_000 10_000 0
54+
void
55+
$ withConwayFindLeaderAndSubmitTx interpreter mockServer
56+
$ Conway.mkPaymentTx (UTxOIndex 1) (UTxOIndex 0) 10_000 10_000 0
5757
-- Add some more empty blocks
5858
void $ forgeAndSubmitBlocks interpreter mockServer 60
5959

0 commit comments

Comments
 (0)