Skip to content

Commit

Permalink
more hlint
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed Dec 5, 2022
1 parent c594881 commit c4ffa72
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/dbvar/src/Database/Persist/Delta.hs
Expand Up @@ -160,7 +160,7 @@ newDatabaseStore db = do
rememberSupply (apply ds table) -- need to use updated supply
}
where
debug m = when False m
debug = when False

update1 _ (InsertManyDB zs) = void $ repsertMany db zs
update1 _ (DeleteManyDB ks) = forM_ ks $ deleteOne db
Expand Down
3 changes: 1 addition & 2 deletions lib/wallet/exe/cardano-wallet.hs
Expand Up @@ -229,7 +229,7 @@ cmdServe = command "serve" $ info (helper <*> helper' <*> cmd) $
Left err -> do
logError tr (MsgFailedToParseGenesis $ T.pack err)
exitWith $ ExitFailure 33
whenJust databaseDir $
forM_ databaseDir $
setupDirectory (logInfo tr . MsgSetupDatabases)

blockchainSource <- case mode of
Expand Down Expand Up @@ -264,7 +264,6 @@ cmdServe = command "serve" $ info (helper <*> helper' <*> cmd) $
block0
(beforeMainLoop tr)

whenJust m fn = Data.Foldable.forM_ m fn
withShutdownHandlerMaybe :: Trace IO MainLog -> Bool -> IO () -> IO ()
withShutdownHandlerMaybe _ False = void
withShutdownHandlerMaybe tr True = void . withShutdownHandler trShutdown
Expand Down
2 changes: 1 addition & 1 deletion lib/wallet/integration/src/Test/Integration/Faucet.hs
Expand Up @@ -2391,7 +2391,7 @@ shelleyIntegrationTestFunds = mconcat
, mirWallets
]
where
defaultAmt = Coin 100000000000
defaultAmt = Coin 100_000_000_000

-- NOTE: Generating e.g. 100 addresses for inclusion in the shelley genesis
-- sgInitialFunds could theoretically cause some funds not to be
Expand Down
Expand Up @@ -1007,7 +1007,7 @@ sharedAccPubKeyFromMnemonics
-> Text
sharedAccPubKeyFromMnemonics mnemonic1 mnemonic2 ix passphrase =
T.decodeUtf8 $ encode (EBech32 hrp) $ xpubToBytes $ getRawKey $ publicKey $
deriveAccountPrivateKey passphrase rootXPrv (Index $ 2147483648 + ix)
deriveAccountPrivateKey passphrase rootXPrv (Index $ 2_147_483_648 + ix)
where
hrp = [Bech32.humanReadablePart|acct_shared_xvk|]
rootXPrv = Shared.generateKeyFromSeed (mnemonic1, mnemonic2) passphrase
Expand Down
Expand Up @@ -468,7 +468,7 @@ spec = describe "SHARED_WALLETS" $ do
(`shouldBe` Nothing)
, expectField
(traverse . #accountIndex . #getApiT)
(`shouldBe` DerivationIndex 2147483658)
(`shouldBe` DerivationIndex 2_147_483_658)
]

let wal = getFromResponse id rPost
Expand Down
Expand Up @@ -2759,7 +2759,7 @@ spec = describe "NEW_SHELLEY_TRANSACTIONS" $ do
(Link.createUnsignedTransaction @'Shelley src) Default delegationJoin
verify rTx1
[ expectResponseCode HTTP.status202
, expectField (#coinSelection . #depositsTaken) (`shouldBe` [Quantity 1000000])
, expectField (#coinSelection . #depositsTaken) (`shouldBe` [Quantity 1_000_000])
, expectField (#coinSelection . #depositsReturned) (`shouldBe` [])
]

Expand All @@ -2771,7 +2771,7 @@ spec = describe "NEW_SHELLEY_TRANSACTIONS" $ do
(Link.decodeTransaction @'Shelley src) Default decodePayload1
verify rDecodedTx1
[ expectResponseCode HTTP.status202
, expectField #depositsTaken (`shouldBe` [Quantity 1000000])
, expectField #depositsTaken (`shouldBe` [Quantity 1_000_000])
, expectField #depositsReturned (`shouldBe` [])
]

Expand Down
5 changes: 2 additions & 3 deletions lib/wallet/test/unit/Cardano/Wallet/Primitive/TypesSpec.hs
Expand Up @@ -1122,9 +1122,8 @@ instance (Arbitrary a, Ord a) => Arbitrary (NonSingletonRange a) where
arbitrary = do
-- Iterate through the infinite list of arbitrary ranges and return
-- the first range that is not a singleton range:
ranges <- infiniteList
pure $ head $ mapMaybe
(makeNonSingletonRangeValid . NonSingletonRange) ranges
head . mapMaybe (makeNonSingletonRangeValid . NonSingletonRange)
<$> infiniteList
shrink (NonSingletonRange r) = mapMaybe
(makeNonSingletonRangeValid . NonSingletonRange) (shrink r)

Expand Down
Expand Up @@ -2101,8 +2101,8 @@ mockProtocolParameters = dummyProtocolParameters
(577 % 10_000)
, txParameters = TxParameters
{ getFeePolicy = mockFeePolicy
, getTxMaxSize = Quantity 16384
, getTokenBundleMaxSize = TokenBundleMaxSize $ TxSize 4000
, getTxMaxSize = Quantity 16_384
, getTokenBundleMaxSize = TokenBundleMaxSize $ TxSize 4_000
, getMaxExecutionUnits = ExecutionUnits 10_000_000_000 14_000_000
}
, minimumUTxO = minimumUTxOForShelleyBasedEra Cardano.ShelleyBasedEraAlonzo
Expand Down

0 comments on commit c4ffa72

Please sign in to comment.