diff --git a/cardano-cli/cardano-cli.cabal b/cardano-cli/cardano-cli.cabal index 2db3b28141..7311278654 100644 --- a/cardano-cli/cardano-cli.cabal +++ b/cardano-cli/cardano-cli.cabal @@ -372,7 +372,6 @@ test-suite cardano-cli-golden cardano-cli, cardano-cli:cardano-cli-test-lib, cardano-crypto-wrapper, - cardano-data >=1.1, cardano-ledger-byron, cardano-ledger-shelley >=1.10.0.0, cardano-strict-containers ^>=0.1, diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis.hs index ca530fa6a2..e53b7f843d 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis.hs @@ -769,7 +769,7 @@ updateOutputTemplate , sgMaxLovelaceSupply = fromIntegral $ nonDelegCoin + delegCoin , sgGenDelegs = shelleyDelKeys , sgInitialFunds = - ListMap.fromList + fromList [ (toShelleyAddr addr, v) | (addr, v) <- distribute (nonDelegCoin - subtractForTreasury) nUtxoAddrsNonDeleg utxoAddrsNonDeleg @@ -1080,7 +1080,7 @@ updateTemplate , sgMaxLovelaceSupply = fromIntegral $ nonDelegCoin + delegCoin , sgGenDelegs = shelleyDelKeys , sgInitialFunds = - ListMap.fromList + fromList [ (toShelleyAddr addr, v) | (addr, v) <- distribute (nonDelegCoin - subtractForTreasury) utxoAddrsNonDeleg @@ -1090,7 +1090,7 @@ updateTemplate , sgStaking = ShelleyGenesisStaking { sgsPools = - ListMap.fromList + fromList [ (L.ppId poolParams, poolParams) | poolParams <- Map.elems poolSpecs ] diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis/CreateTestnetData.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis/CreateTestnetData.hs index 774736c8d0..b867d7072e 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis/CreateTestnetData.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis/CreateTestnetData.hs @@ -57,7 +57,6 @@ import qualified Data.Aeson as Aeson import Data.Bifunctor (Bifunctor (..)) import qualified Data.ByteString.Lazy.Char8 as LBS import Data.ListMap (ListMap (..)) -import qualified Data.ListMap as ListMap import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map import Data.Maybe (fromMaybe) @@ -351,7 +350,7 @@ runGenesisCreateTestNetDataCmd :: [(VerificationKey StakeKey, VerificationKey DRepKey)] -> ListMap (L.Credential L.Staking L.StandardCrypto) (L.Delegatee L.StandardCrypto) delegs = - ListMap.fromList + fromList . map ( bimap verificationKeytoStakeCredential @@ -363,7 +362,7 @@ runGenesisCreateTestNetDataCmd -> [VerificationKey DRepKey] -> ListMap (L.Credential L.DRepRole L.StandardCrypto) (L.DRepState L.StandardCrypto) initialDReps minDeposit = - ListMap.fromList + fromList . map ( \c -> ( verificationKeyToDRepCredential c @@ -706,7 +705,7 @@ updateOutputTemplate , sgMaxLovelaceSupply = totalSupply , sgGenDelegs = shelleyDelKeys , sgInitialFunds = - ListMap.fromList + fromList [ (toShelleyAddr addr, v) | (addr, v) <- distribute nonDelegCoin nUtxoAddrsNonDeleg utxoAddrsNonDeleg diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs index a57963e2f2..d305d34e70 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs @@ -1107,10 +1107,9 @@ writePoolState mOutFile serialisedCurrentEpochState = do let hks :: [L.KeyHash L.StakePool StandardCrypto] hks = toList $ - fromList @(Set (L.KeyHash L.StakePool StandardCrypto)) $ - Map.keys (L.psStakePoolParams poolState) - <> Map.keys (L.psFutureStakePoolParams poolState) - <> Map.keys (L.psRetiring poolState) + Map.keysSet (L.psStakePoolParams poolState) + <> Map.keysSet (L.psFutureStakePoolParams poolState) + <> Map.keysSet (L.psRetiring poolState) let poolStates :: Map (L.KeyHash 'L.StakePool StandardCrypto) (Params StandardCrypto) poolStates = diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs index 5f87816aff..59d6942e8c 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs @@ -64,6 +64,7 @@ import Data.Bifunctor (Bifunctor (..)) import qualified Data.ByteString as Data.Bytestring import qualified Data.ByteString.Char8 as BS import qualified Data.ByteString.Lazy.Char8 as LBS +import Data.Containers.ListUtils (nubOrd) import Data.Data ((:~:) (..)) import qualified Data.Foldable as Foldable import Data.Function ((&)) @@ -199,7 +200,7 @@ runTransactionBuildCmd <$> readTxGovernanceActions eon proposalFiles -- the same collateral input can be used for several plutus scripts - let filteredTxinsc = toList @(Set _) $ fromList txinsc + let filteredTxinsc = nubOrd txinsc let allReferenceInputs = getAllReferenceInputs diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/CreateTestnetData.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/CreateTestnetData.hs index 5ee717e57b..eee953edd5 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/CreateTestnetData.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/CreateTestnetData.hs @@ -13,9 +13,9 @@ import qualified Cardano.Ledger.Shelley.API as L import Control.Monad import Control.Monad.IO.Class import Data.List (intercalate, sort) -import qualified Data.ListMap as ListMap import qualified Data.Sequence.Strict as Seq import Data.Word (Word32) +import GHC.Exts (IsList (..)) import System.Directory import System.Directory.Extra (listDirectories) import System.FilePath @@ -179,7 +179,7 @@ hprop_golden_create_testnet_data_deleg_non_deleg = -- Because we don't test this elsewhere in this file: (L.sgMaxLovelaceSupply genesis) H.=== (fromIntegral totalSupply) - let initialFunds = ListMap.toList $ L.sgInitialFunds genesis + let initialFunds = toList $ L.sgInitialFunds genesis -- This checks that there is actually only one funded address (length initialFunds) H.=== 1