-
Notifications
You must be signed in to change notification settings - Fork 722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New File type that tracks whether the file is an input or output file or both #5017
Changes from all commits
9be44ba
970406d
26abc42
cb18ddc
1aea008
e8e32fb
5bcf42b
8846dbc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE DeriveGeneric #-} | ||
{-# LANGUAGE RecordWildCards #-} | ||
{-# LANGUAGE StandaloneDeriving #-} | ||
|
@@ -23,7 +24,7 @@ import Cardano.CLI.Types (SigningKeyFile (..)) | |
import Cardano.Node.Configuration.NodeAddress (NodeIPv4Address) | ||
import Cardano.Node.Types (AdjustFilePaths (..)) | ||
|
||
import Cardano.Api (AnyCardanoEra, Lovelace) | ||
import Cardano.Api (AnyCardanoEra, FileDirection (..), Lovelace, MapFile (..)) | ||
import Cardano.TxGenerator.Internal.Orphans () | ||
import Cardano.TxGenerator.Types | ||
|
||
|
@@ -42,7 +43,7 @@ data NixServiceOptions = NixServiceOptions { | |
, _nix_plutus :: Maybe TxGenPlutusParams | ||
, _nix_nodeConfigFile :: Maybe FilePath | ||
, _nix_cardanoTracerSocket :: Maybe FilePath | ||
, _nix_sigKey :: SigningKeyFile | ||
, _nix_sigKey :: SigningKeyFile 'In | ||
, _nix_localNodeSocketPath :: String | ||
, _nix_targetNodes :: NonEmpty NodeIPv4Address | ||
} deriving (Show, Eq) | ||
|
@@ -70,7 +71,7 @@ instance AdjustFilePaths NixServiceOptions where | |
adjustFilePaths f opts | ||
= opts { | ||
_nix_nodeConfigFile = f <$> _nix_nodeConfigFile opts | ||
, _nix_sigKey = SigningKeyFile . f . unSigningKeyFile $ _nix_sigKey opts | ||
, _nix_sigKey = mapFile f $ _nix_sigKey opts | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. An example of how Without the
|
||
} | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,13 @@ module Cardano.Api ( | |
shelleyBasedToCardanoEra, | ||
|
||
-- ** IO | ||
OutputFile(..), | ||
File(..), | ||
MapFile(..), | ||
Directory(..), | ||
FileDirection(..), | ||
|
||
toFileIn, | ||
toFileOut, | ||
|
||
writeByteStringFileWithOwnerPermissions, | ||
writeByteStringFile, | ||
|
@@ -765,7 +771,6 @@ module Cardano.Api ( | |
chainPointToSlotNo, | ||
chainPointToHeaderHash, | ||
makeChainTip, | ||
parseFilePath, | ||
writeSecrets, | ||
|
||
-- ** Cast functions | ||
|
@@ -797,6 +802,21 @@ module Cardano.Api ( | |
|
||
-- ** CLI option parsing | ||
bounded, | ||
fileOption, | ||
inFileOption, | ||
outFileOption, | ||
parseFile, | ||
parseFileIn, | ||
parseFilePath, | ||
parseFileOut, | ||
parseDirectory, | ||
|
||
toGenesisFileIn, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These functions aren't used anywhere. Why implement them? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For completeness so that if someone wanted to use them, they'd be available. |
||
toGenesisFileOut, | ||
toNetworkConfigFileIn, | ||
toNetworkConfigFileOut, | ||
toNodeConfigIn, | ||
toNodeConfigOut, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are the functions that have been added in order to delete |
||
) where | ||
|
||
import Cardano.Api.Address | ||
|
@@ -827,6 +847,7 @@ import Cardano.Api.LedgerState | |
import Cardano.Api.Modes | ||
import Cardano.Api.NetworkId | ||
import Cardano.Api.OperationalCertificate | ||
import Cardano.Api.Options | ||
import Cardano.Api.Protocol | ||
import Cardano.Api.ProtocolParameters | ||
import Cardano.Api.Query hiding (LedgerState (..)) | ||
|
@@ -845,3 +866,4 @@ import Cardano.Api.TxMetadata | |
import Cardano.Api.Utils | ||
import Cardano.Api.Value | ||
import Cardano.Api.ValueParser | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually make use of the pragma
{-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-}
but it's not the end of the world if we don't.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we bump to 9.6.1 we can replace
DataKinds
withTypeData
: https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/type_data.html