diff --git a/lib/coin-selection/test/spec/Cardano/CoinSelection/BalanceSpec.hs b/lib/coin-selection/test/spec/Cardano/CoinSelection/BalanceSpec.hs index b63e05917e2..1358d278800 100644 --- a/lib/coin-selection/test/spec/Cardano/CoinSelection/BalanceSpec.hs +++ b/lib/coin-selection/test/spec/Cardano/CoinSelection/BalanceSpec.hs @@ -1070,7 +1070,7 @@ prop_performSelection mockConstraints params coverage = -- -- We expect that the selection should succeed. -- - let constraints' :: SelectionConstraints TestSelectionContext = + let constraints' = constraints { assessTokenBundleSize = unMockAssessTokenBundleSize MockAssessTokenBundleSizeUnlimited @@ -1078,7 +1078,7 @@ prop_performSelection mockConstraints params coverage = const computeMinimumAdaQuantityZero , computeMinimumCost = computeMinimumCostZero , computeSelectionLimit = const NoLimit - } + } :: SelectionConstraints TestSelectionContext performSelection' = performSelection constraints' params in monadicIO $ run performSelection' >>= \case diff --git a/lib/coin-selection/test/spec/Cardano/CoinSelectionSpec.hs b/lib/coin-selection/test/spec/Cardano/CoinSelectionSpec.hs index 2a8599fd04a..863ac97fae2 100644 --- a/lib/coin-selection/test/spec/Cardano/CoinSelectionSpec.hs +++ b/lib/coin-selection/test/spec/Cardano/CoinSelectionSpec.hs @@ -457,7 +457,11 @@ prop_prepareOutputsWith_twice minCoinValueDef outs = once === twice where minCoinValueFor = unMockComputeMinimumAdaQuantity minCoinValueDef - (_:once:twice:_) = iterate (prepareOutputsWith minCoinValueFor) outs + (once, twice) = + case iterate (prepareOutputsWith minCoinValueFor) outs of + (_:a:b:_) -> (a, b) + _else -> error "prop_prepareOutputsWith_twice" + prop_prepareOutputsWith_length :: MockComputeMinimumAdaQuantity diff --git a/lib/primitive/test/spec/Cardano/Wallet/Primitive/Types/TokenMapSpec.hs b/lib/primitive/test/spec/Cardano/Wallet/Primitive/Types/TokenMapSpec.hs index b1c175a26ed..890b07f7cbd 100644 --- a/lib/primitive/test/spec/Cardano/Wallet/Primitive/Types/TokenMapSpec.hs +++ b/lib/primitive/test/spec/Cardano/Wallet/Primitive/Types/TokenMapSpec.hs @@ -384,7 +384,10 @@ prop_subtract_invariant :: TokenMap -> TokenMap -> Property prop_subtract_invariant m1 m2 = property $ m2 `leq` m1 ==> invariantHolds result where - Just result = TokenMap.subtract m1 m2 + result = + case TokenMap.subtract m1 m2 of + Nothing -> error "prop_subtract_invariant" + Just r -> r prop_difference_invariant :: TokenMap -> TokenMap -> Property prop_difference_invariant m1 m2 = diff --git a/lib/wallet/src/Cardano/Wallet/Pools.hs b/lib/wallet/src/Cardano/Wallet/Pools.hs index b7a667a131e..1a2749e6fd0 100644 --- a/lib/wallet/src/Cardano/Wallet/Pools.hs +++ b/lib/wallet/src/Cardano/Wallet/Pools.hs @@ -436,8 +436,8 @@ combineDbAndLsqData ti nOpt lsqData = = Coin $ average $ L.take nOpt - $ L.sort - $ map (Down . unCoin . view #nonMyopicMemberRewards) + $ L.sortOn Down + $ map (unCoin . view #nonMyopicMemberRewards) $ Map.elems lsqData where average [] = 0 diff --git a/lib/wallet/src/Cardano/Wallet/Read/Tx/Witnesses.hs b/lib/wallet/src/Cardano/Wallet/Read/Tx/Witnesses.hs index 50f6659fcde..5f8a4c7fc4b 100644 --- a/lib/wallet/src/Cardano/Wallet/Read/Tx/Witnesses.hs +++ b/lib/wallet/src/Cardano/Wallet/Read/Tx/Witnesses.hs @@ -1,4 +1,5 @@ {-# LANGUAGE DataKinds #-} +{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-}