Skip to content

Commit e28136f

Browse files
committed
fourmolu and pr stuff
1 parent 7d4d89a commit e28136f

File tree

5 files changed

+22
-23
lines changed

5 files changed

+22
-23
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module Cardano.Mock.Forging.Tx.Conway (
3838
mkNewConstitutionTx,
3939
mkDummyRegisterTx,
4040
mkDummyTxBody,
41-
mkDummyTxBodyWithCoin,
41+
mkDummyTxBodyWithFee,
4242
mkTxDelegCert,
4343
mkRegTxCert,
4444
mkUnRegTxCert,
@@ -590,10 +590,10 @@ mkDummyTxBody =
590590
mempty
591591
(Withdrawals mempty)
592592

593-
mkDummyTxBodyWithCoin ::
593+
mkDummyTxBodyWithFee ::
594594
Coin ->
595595
ConwayTxBody StandardConway
596-
mkDummyTxBodyWithCoin coin' =
596+
mkDummyTxBodyWithFee coin' =
597597
consTxBody
598598
mempty
599599
mempty

cardano-chain-gen/test/Test/Cardano/Db/Mock/Config.hs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ import Control.Concurrent.STM.TMVar (
6767
tryPutTMVar,
6868
tryReadTMVar,
6969
)
70-
import Control.Exception (SomeException, bracket)
70+
import Control.Exception (SomeException, bracket, catch)
7171
import Control.Monad (void)
7272
import Control.Monad.Extra (eitherM)
7373
import Control.Monad.Logger (NoLoggingT, runNoLoggingT)
@@ -85,9 +85,8 @@ import Ouroboros.Consensus.Shelley.Node (ShelleyLeaderCredentials)
8585
import System.Directory (createDirectoryIfMissing, removePathForcibly)
8686
import System.FilePath.Posix (takeDirectory, (</>))
8787
import System.IO.Silently (hSilence)
88-
import Test.Tasty.HUnit (Assertion, testCase, assertFailure)
89-
import Control.Exception (catch)
9088
import Test.Tasty (TestTree)
89+
import Test.Tasty.HUnit (Assertion, assertFailure, testCase)
9190

9291
data Config = Config
9392
{ topLevelConfig :: TopLevelConfig CardanoBlock
@@ -523,7 +522,7 @@ replaceConfigFile newFilename dbSync@DBSyncEnv {..} = do
523522

524523
expectFailSilent :: String -> Assertion -> TestTree
525524
expectFailSilent name action = testCase name $ do
526-
result <- catch (Right <$> action) (\(_ :: SomeException) -> pure $ Left ())
527-
case result of
528-
Left _ -> pure () -- Test failed as expected, do nothing
529-
Right _ -> assertFailure "Expected test to fail but it succeeded"
525+
result <- catch (Right <$> action) (\(_ :: SomeException) -> pure $ Left ())
526+
case result of
527+
Left _ -> pure () -- Test failed as expected, do nothing
528+
Right _ -> assertFailure "Expected test to fail but it succeeded"

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,12 @@ addTxMetadataWhitelist ioManager metadata = do
181181
-- Add transactions with metadata
182182
void $ do
183183
UnifiedApi.withConwayFindLeaderAndSubmitTx interpreter mockServer $ \_ ->
184-
let txBody = Conway.mkDummyTxBodyWithCoin $ Coin 1_000
184+
let txBody = Conway.mkDummyTxBodyWithFee $ Coin 1_000
185185
auxData = Map.fromList [(1, I 1), (2, I 2), (3, I 3), (4, I 4)]
186186
in Right (Conway.mkAuxDataTx True txBody auxData)
187187
void $ do
188188
UnifiedApi.withConwayFindLeaderAndSubmitTx interpreter mockServer $ \_ ->
189-
let txBody = Conway.mkDummyTxBodyWithCoin $ Coin 2_000
189+
let txBody = Conway.mkDummyTxBodyWithFee $ Coin 2_000
190190
auxData = Map.fromList [(5, I 5), (6, I 6), (7, I 7), (8, I 8)]
191191
in Right (Conway.mkAuxDataTx True txBody auxData)
192192

@@ -222,12 +222,12 @@ addTxMetadataWhitelistMultiple ioManager metadata = do
222222
-- Add transactions with metadata
223223
void $ do
224224
UnifiedApi.withConwayFindLeaderAndSubmitTx interpreter mockServer $ \_ ->
225-
let txBody = Conway.mkDummyTxBodyWithCoin $ Coin 1_000
225+
let txBody = Conway.mkDummyTxBodyWithFee $ Coin 1_000
226226
auxData = Map.fromList [(1, I 1), (2, I 2), (3, I 3), (4, I 4)]
227227
in Right (Conway.mkAuxDataTx True txBody auxData)
228228
void $ do
229229
UnifiedApi.withConwayFindLeaderAndSubmitTx interpreter mockServer $ \_ ->
230-
let txBody = Conway.mkDummyTxBodyWithCoin $ Coin 2_000
230+
let txBody = Conway.mkDummyTxBodyWithFee $ Coin 2_000
231231
auxData = Map.fromList [(5, I 5), (6, I 6), (7, I 7), (8, I 8)]
232232
in Right (Conway.mkAuxDataTx True txBody auxData)
233233

cardano-db-sync/src/Cardano/DbSync/Era/Universal/Insert/Other.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ insertMultiAsset ::
170170
PolicyID StandardCrypto ->
171171
AssetName ->
172172
ReaderT SqlBackend m (Maybe DB.MultiAssetId)
173-
insertMultiAsset _tracer cache mWhitelist policy aName = do
173+
insertMultiAsset cache mWhitelist policy aName = do
174174
mId <- queryMAWithCache cache policy aName
175175
case mId of
176176
Right maId -> pure $ Just maId

cardano-db-sync/src/Cardano/DbSync/Era/Universal/Insert/Tx.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ insertTx syncEnv isMember blkId epochNo slotNo applyResult blockIndex tx grouped
175175
maTxMint <-
176176
case ioMultiAssets iopts of
177177
MultiAssetDisable -> pure mempty
178-
MultiAssetEnable -> insertMaTxMint tracer cache Nothing txId $ Generic.txMint tx
179-
MultiAssetPolicies whitelist -> insertMaTxMint tracer cache (Just whitelist) txId $ Generic.txMint tx
178+
MultiAssetEnable -> insertMaTxMint cache Nothing txId $ Generic.txMint tx
179+
MultiAssetPolicies whitelist -> insertMaTxMint cache (Just whitelist) txId $ Generic.txMint tx
180180

181181
when (isPlutusEnabled $ ioPlutus iopts) $
182182
mapM_ (lift . insertScript tracer txId) $
@@ -245,10 +245,10 @@ insertTxOut tracer cache iopts (txId, txHash) (Generic.TxOut index addr value ma
245245
case ioMultiAssets iopts of
246246
MultiAssetDisable -> pure (eutxo, mempty)
247247
MultiAssetEnable -> do
248-
!maTxOuts <- insertMaTxOuts tracer cache Nothing maMap
248+
!maTxOuts <- insertMaTxOuts cache Nothing maMap
249249
pure (eutxo, maTxOuts)
250250
MultiAssetPolicies whitelist -> do
251-
!maTxOuts <- insertMaTxOuts tracer cache (Just whitelist) maMap
251+
!maTxOuts <- insertMaTxOuts cache (Just whitelist) maMap
252252
pure (eutxo, maTxOuts)
253253

254254
hasScript :: Bool
@@ -317,7 +317,7 @@ insertMaTxMint ::
317317
DB.TxId ->
318318
MultiAsset StandardCrypto ->
319319
ExceptT SyncNodeError (ReaderT SqlBackend m) [DB.MaTxMint]
320-
insertMaTxMint tracer cache mWhitelist txId (MultiAsset mintMap) =
320+
insertMaTxMint cache mWhitelist txId (MultiAsset mintMap) =
321321
concatMapM (lift . prepareOuter) $ Map.toList mintMap
322322
where
323323
prepareOuter ::
@@ -333,7 +333,7 @@ insertMaTxMint tracer cache mWhitelist txId (MultiAsset mintMap) =
333333
(AssetName, Integer) ->
334334
ReaderT SqlBackend m (Maybe DB.MaTxMint)
335335
prepareInner policy (aname, amount) = do
336-
maybeMaId <- insertMultiAsset tracer cache mWhitelist policy aname
336+
maybeMaId <- insertMultiAsset cache mWhitelist policy aname
337337
pure $ case maybeMaId of
338338
Just maId ->
339339
Just $
@@ -351,7 +351,7 @@ insertMaTxOuts ::
351351
Maybe (NonEmpty ShortByteString) ->
352352
Map (PolicyID StandardCrypto) (Map AssetName Integer) ->
353353
ExceptT SyncNodeError (ReaderT SqlBackend m) [MissingMaTxOut]
354-
insertMaTxOuts tracer cache mWhitelist maMap =
354+
insertMaTxOuts cache mWhitelist maMap =
355355
concatMapM (lift . prepareOuter) $ Map.toList maMap
356356
where
357357
prepareOuter ::
@@ -367,7 +367,7 @@ insertMaTxOuts tracer cache mWhitelist maMap =
367367
(AssetName, Integer) ->
368368
ReaderT SqlBackend m (Maybe MissingMaTxOut)
369369
prepareInner policy (aname, amount) = do
370-
mMaId <- insertMultiAsset tracer cache mWhitelist policy aname
370+
mMaId <- insertMultiAsset cache mWhitelist policy aname
371371
pure $ case mMaId of
372372
Just maId ->
373373
Just $

0 commit comments

Comments
 (0)