From 00213c90ff2dd258902a25e581cf72b9d5b01bdd Mon Sep 17 00:00:00 2001 From: Paolo Veronelli Date: Tue, 10 May 2022 10:47:47 +0200 Subject: [PATCH] remove duplicate MetadataSchema datatype --- lib/cli/src/Cardano/CLI.hs | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/lib/cli/src/Cardano/CLI.hs b/lib/cli/src/Cardano/CLI.hs index fe298d6e535..45c5d33b607 100644 --- a/lib/cli/src/Cardano/CLI.hs +++ b/lib/cli/src/Cardano/CLI.hs @@ -730,12 +730,9 @@ cmdWalletGetUtxoStatistics mkClient = data TransactionFeatures = NoShelleyFeatures | ShelleyFeatures deriving (Show, Eq) -data MetadataSchema = SimpleSchema | FullSchema - deriving (Show, Eq) - -- | which json schema to use for output, True is simple -metadataSchemaOption :: Parser MetadataSchema -metadataSchemaOption = flag FullSchema SimpleSchema +metadataSchemaOption :: Parser TxMetadataSchema +metadataSchemaOption = flag TxMetadataDetailedSchema TxMetadataNoSchema $ long "simple-metadata" <> help "output metadata json in no-schema encoding" @@ -855,7 +852,7 @@ data TransactionListArgs = TransactionListArgs , _timeRangeStart :: Maybe Iso8601Time , _timeRangeEnd :: Maybe Iso8601Time , _sortOrder :: Maybe SortOrder - , _schema :: MetadataSchema + , _schema :: TxMetadataSchema } cmdTransactionList @@ -881,7 +878,7 @@ cmdTransactionList mkTxClient = mTimeRangeStart mTimeRangeEnd (ApiT <$> mOrder) - (metadataSchema == SimpleSchema) + (metadataSchema == TxMetadataNoSchema) -- | Arguments for 'transaction submit' command data TransactionSubmitArgs = TransactionSubmitArgs @@ -931,7 +928,7 @@ data TransactionGetArgs = TransactionGetArgs { _port :: Port "Wallet" , _wid :: WalletId , _txid :: TxId - , _schema :: MetadataSchema + , _schema :: TxMetadataSchema } cmdTransactionGet @@ -950,12 +947,7 @@ cmdTransactionGet mkClient = runClient wPort Aeson.encodePretty $ getTransaction mkClient (ApiT wId) (ApiTxId $ ApiT $ getTxId txId) - (metadataSchemaToTxMetadataSchema metadataSchema) - -metadataSchemaToTxMetadataSchema :: MetadataSchema -> TxMetadataSchema -metadataSchemaToTxMetadataSchema = \case - SimpleSchema -> TxMetadataNoSchema - FullSchema -> TxMetadataDetailedSchema + metadataSchema {------------------------------------------------------------------------------- Commands - 'address'