Skip to content
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

Close me #399

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions cardano-cli/src/Cardano/CLI/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ parseByron mNetworkId =
, command' "byron" "Byron specific commands" $ parseByronCommands mNetworkId
]

{-
We don't care about the era here because this is simply a backwards compatible
command that is expected to work over all eras.

We need to be able to parse: Inputs, outputs, update proposals, stake registration, stake delegation and
pool registration is all that we need in previous eras.
-}
parseShelleyToBeforeMainnet :: EnvCli -> Parser ClientCommand
parseShelleyToBeforeMainnet _ = PreMainnetCommand <$> error "TODO"


parsePing :: Parser ClientCommand
parsePing = CliPingCommand <$> parsePingCmd

Expand Down
16 changes: 16 additions & 0 deletions cardano-cli/src/Cardano/CLI/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
, runClientCommand
) where

import Cardano.Api

import Cardano.CLI.Byron.Commands (ByronCommand)
import Cardano.CLI.Byron.Run (ByronClientCmdError, renderByronClientCmdError,
runByronClientCommand)
Expand Down Expand Up @@ -45,6 +47,7 @@

-- | Byron Related Commands
| ByronCommand ByronCommand
| PreMainnetCommand PreMainnetCommand

-- | Legacy shelley-based Commands
| LegacyCmds LegacyCmds
Expand All @@ -54,6 +57,19 @@
| forall a. Help ParserPrefs (ParserInfo a)
| DisplayVersion


data PreMainnetCommand
= PreMainnetTxBuild PreMainnetTransactionBuildCmdArgs
Comment on lines +61 to +62

Check notice

Code scanning / HLint

Use newtype instead of data Note

cardano-cli/src/Cardano/CLI/Run.hs:(61,1)-(62,54): Suggestion: Use newtype instead of data
  
Found:
  data PreMainnetCommand
    = PreMainnetTxBuild PreMainnetTransactionBuildCmdArgs
  
Perhaps:
  newtype PreMainnetCommand
    = PreMainnetTxBuild PreMainnetTransactionBuildCmdArgs
  
Note: decreases laziness


-- E.g something like this that offers the minimum required functionality.
-- We also need key generation commands to work to run SPOs etc
data PreMainnetTransactionBuildCmdArgs = TransactionBuildCmdArgs
{ nodeSocketPath :: !SocketPath
, networkId :: !NetworkId
, txins :: ![TxIn]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't fully flesh out this type but you get the idea. We're missing outputs etc.

}

data ClientCommandErrors
= ByronClientError ByronClientCmdError
| CmdError Text CmdError
Expand Down
Loading