Skip to content

Commit

Permalink
Remove genesis hash command
Browse files Browse the repository at this point in the history
  • Loading branch information
palas committed Nov 28, 2024
1 parent 7dc09c9 commit e7c8634
Show file tree
Hide file tree
Showing 23 changed files with 0 additions and 154 deletions.
3 changes: 0 additions & 3 deletions cardano-cli/src/Cardano/CLI/EraBased/Commands/Genesis.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ data GenesisCmds era
| GenesisVerKey !GenesisVerKeyCmdArgs
| GenesisTxIn !GenesisTxInCmdArgs
| GenesisAddr !GenesisAddrCmdArgs
| GenesisHashFile !GenesisFile
deriving Show

data GenesisCreateCmdArgs era = GenesisCreateCmdArgs
Expand Down Expand Up @@ -192,5 +191,3 @@ renderGenesisCmds = \case
"genesis initial-txin"
GenesisAddr{} ->
"genesis initial-addr"
GenesisHashFile{} ->
"genesis hash"
8 changes: 0 additions & 8 deletions cardano-cli/src/Cardano/CLI/EraBased/Options/Genesis.hs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ pGenesisCmds era envCli =
mconcat
[ "Create data to use for starting a testnet."
]
, Just $
subParser "hash" $
Opt.info pGenesisHash $
Opt.progDesc "Compute the hash of a genesis file"
]

pGenesisKeyGen :: Parser (GenesisCmds era)
Expand Down Expand Up @@ -360,10 +356,6 @@ pGenesisCreateTestNetData sbe envCli =
, Opt.help "The directory where to generate the data. Created if not existing."
]

pGenesisHash :: Parser (GenesisCmds era)
pGenesisHash =
GenesisHashFile <$> pGenesisFile "The genesis file."

pGenesisDir :: Parser GenesisDir
pGenesisDir =
fmap GenesisDir $
Expand Down
12 changes: 0 additions & 12 deletions cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module Cardano.CLI.EraBased.Run.Genesis
, runGenesisCreateCardanoCmd
, runGenesisCreateCmd
, runGenesisCreateStakedCmd
, runGenesisHashFileCmd
, runGenesisKeyHashCmd
, runGenesisTxInCmd
, runGenesisVerKeyCmd
Expand Down Expand Up @@ -108,7 +107,6 @@ runGenesisCmds = \case
GenesisCreateCardano args -> runGenesisCreateCardanoCmd args
GenesisCreateStaked args -> runGenesisCreateStakedCmd args
GenesisCreateTestNetData args -> TN.runGenesisCreateTestNetDataCmd args
GenesisHashFile gf -> runGenesisHashFileCmd gf

runGenesisKeyHashCmd :: VerificationKeyFile In -> ExceptT GenesisCmdError IO ()
runGenesisKeyHashCmd vkeyPath = do
Expand Down Expand Up @@ -1341,13 +1339,3 @@ readInitialFundAddresses utxodir nw = do
(PaymentCredentialByKey vkh)
NoStakeAddress
]

-- | Hash a genesis file
runGenesisHashFileCmd :: GenesisFile -> ExceptT GenesisCmdError IO ()
runGenesisHashFileCmd (GenesisFile fpath) = do
content <-
handleIOExceptT (GenesisCmdGenesisFileError . FileIOError fpath) $
BS.readFile fpath
let gh :: Crypto.Hash Crypto.Blake2b_256 ByteString
gh = Crypto.hashWith id content
liftIO $ Text.putStrLn (Crypto.hashToTextAsHex gh)
3 changes: 0 additions & 3 deletions cardano-cli/src/Cardano/CLI/Legacy/Commands/Genesis.hs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ data LegacyGenesisCmds
(VerificationKeyFile In)
NetworkId
(Maybe (File () Out))
| GenesisHashFile
GenesisFile
deriving Show

renderLegacyGenesisCmds :: LegacyGenesisCmds -> Text
Expand All @@ -97,4 +95,3 @@ renderLegacyGenesisCmds = \case
GenesisVerKey{} -> "genesis get-ver-key"
GenesisTxIn{} -> "genesis initial-txin"
GenesisAddr{} -> "genesis initial-addr"
GenesisHashFile{} -> "genesis hash"
7 changes: 0 additions & 7 deletions cardano-cli/src/Cardano/CLI/Legacy/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,6 @@ pGenesisCmds envCli =
[ "Create a staked Shelley genesis file from a genesis "
, "template and genesis/delegation/spending keys."
]
, subParser "hash" $
Opt.info pGenesisHash $
Opt.progDesc "Compute the hash of a genesis file"
]
where
pGenesisKeyGen :: Parser LegacyGenesisCmds
Expand Down Expand Up @@ -278,10 +275,6 @@ pGenesisCmds envCli =
<*> pStuffedUtxoCount
<*> Opt.optional pRelayJsonFp

pGenesisHash :: Parser LegacyGenesisCmds
pGenesisHash =
GenesisHashFile <$> pGenesisFile "The genesis file."

pGenesisDir :: Parser GenesisDir
pGenesisDir =
fmap GenesisDir $
Expand Down
9 changes: 0 additions & 9 deletions cardano-cli/src/Cardano/CLI/Legacy/Run/Genesis.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ runLegacyGenesisCmds = \case
runLegacyGenesisCreateCardanoCmd eSbe gd gn un ms am k slotLength sc nw bg sg ag cg mNodeCfg
GenesisCreateStaked eSbe fmt gd gn gp gl un ms am ds nw bf bp su relayJsonFp ->
runLegacyGenesisCreateStakedCmd eSbe fmt gd gn gp gl un ms am ds nw bf bp su relayJsonFp
GenesisHashFile gf ->
runLegacyGenesisHashFileCmd gf

runLegacyGenesisKeyGenGenesisCmd
:: ()
Expand Down Expand Up @@ -271,10 +269,3 @@ runLegacyGenesisCreateStakedCmd
, Cmd.numStuffedUtxo = numStuffedUtxo
, Cmd.mStakePoolRelaySpecFile = mStakePoolRelaySpecFile
}

-- | Hash a genesis file
runLegacyGenesisHashFileCmd
:: ()
=> GenesisFile
-> ExceptT GenesisCmdError IO ()
runLegacyGenesisHashFileCmd = runGenesisHashFileCmd
40 changes: 0 additions & 40 deletions cardano-cli/test/cardano-cli-golden/files/golden/help.cli
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@ Usage: cardano-cli legacy genesis
| create-cardano
| create
| create-staked
| hash
)

Genesis block commands
Expand Down Expand Up @@ -665,10 +664,6 @@ Usage: cardano-cli legacy genesis create-staked
Create a staked Shelley genesis file from a genesis template and
genesis/delegation/spending keys.

Usage: cardano-cli legacy genesis hash --genesis FILEPATH

Compute the hash of a genesis file

Usage: cardano-cli byron
( key
| transaction
Expand Down Expand Up @@ -1095,7 +1090,6 @@ Usage: cardano-cli shelley genesis
| create
| create-staked
| create-testnet-data
| hash
)

Genesis block commands.
Expand Down Expand Up @@ -1217,10 +1211,6 @@ Usage: cardano-cli shelley genesis create-testnet-data [--spec-shelley FILEPATH]

Create data to use for starting a testnet.

Usage: cardano-cli shelley genesis hash --genesis FILEPATH

Compute the hash of a genesis file

Usage: cardano-cli shelley governance
( create-mir-certificate
| create-genesis-key-delegation-certificate
Expand Down Expand Up @@ -2168,7 +2158,6 @@ Usage: cardano-cli allegra genesis
| create
| create-staked
| create-testnet-data
| hash
)

Genesis block commands.
Expand Down Expand Up @@ -2290,10 +2279,6 @@ Usage: cardano-cli allegra genesis create-testnet-data [--spec-shelley FILEPATH]

Create data to use for starting a testnet.

Usage: cardano-cli allegra genesis hash --genesis FILEPATH

Compute the hash of a genesis file

Usage: cardano-cli allegra governance
( create-mir-certificate
| create-genesis-key-delegation-certificate
Expand Down Expand Up @@ -3241,7 +3226,6 @@ Usage: cardano-cli mary genesis
| create
| create-staked
| create-testnet-data
| hash
)

Genesis block commands.
Expand Down Expand Up @@ -3361,10 +3345,6 @@ Usage: cardano-cli mary genesis create-testnet-data [--spec-shelley FILEPATH]

Create data to use for starting a testnet.

Usage: cardano-cli mary genesis hash --genesis FILEPATH

Compute the hash of a genesis file

Usage: cardano-cli mary governance
( create-mir-certificate
| create-genesis-key-delegation-certificate
Expand Down Expand Up @@ -4304,7 +4284,6 @@ Usage: cardano-cli alonzo genesis
| create
| create-staked
| create-testnet-data
| hash
)

Genesis block commands.
Expand Down Expand Up @@ -4424,10 +4403,6 @@ Usage: cardano-cli alonzo genesis create-testnet-data [--spec-shelley FILEPATH]

Create data to use for starting a testnet.

Usage: cardano-cli alonzo genesis hash --genesis FILEPATH

Compute the hash of a genesis file

Usage: cardano-cli alonzo governance
( create-mir-certificate
| create-genesis-key-delegation-certificate
Expand Down Expand Up @@ -5382,7 +5357,6 @@ Usage: cardano-cli babbage genesis
| create
| create-staked
| create-testnet-data
| hash
)

Genesis block commands.
Expand Down Expand Up @@ -5504,10 +5478,6 @@ Usage: cardano-cli babbage genesis create-testnet-data [--spec-shelley FILEPATH]

Create data to use for starting a testnet.

Usage: cardano-cli babbage genesis hash --genesis FILEPATH

Compute the hash of a genesis file

Usage: cardano-cli babbage governance
( create-mir-certificate
| create-genesis-key-delegation-certificate
Expand Down Expand Up @@ -6740,7 +6710,6 @@ Usage: cardano-cli conway genesis
| create
| create-staked
| create-testnet-data
| hash
)

Genesis block commands.
Expand Down Expand Up @@ -6860,10 +6829,6 @@ Usage: cardano-cli conway genesis create-testnet-data [--spec-shelley FILEPATH]

Create data to use for starting a testnet.

Usage: cardano-cli conway genesis hash --genesis FILEPATH

Compute the hash of a genesis file

Usage: cardano-cli conway governance (action | committee | drep | vote)

Governance commands.
Expand Down Expand Up @@ -8740,7 +8705,6 @@ Usage: cardano-cli latest genesis
| create
| create-staked
| create-testnet-data
| hash
)

Genesis block commands.
Expand Down Expand Up @@ -8860,10 +8824,6 @@ Usage: cardano-cli latest genesis create-testnet-data [--spec-shelley FILEPATH]

Create data to use for starting a testnet.

Usage: cardano-cli latest genesis hash --genesis FILEPATH

Compute the hash of a genesis file

Usage: cardano-cli latest governance (action | committee | drep | vote)

Governance commands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Usage: cardano-cli allegra genesis
| create
| create-staked
| create-testnet-data
| hash
)

Genesis block commands.
Expand All @@ -36,4 +35,3 @@ Available commands:
create-staked Create a staked Shelley genesis file from a genesis
template and genesis/delegation/spending keys.
create-testnet-data Create data to use for starting a testnet.
hash Compute the hash of a genesis file

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Usage: cardano-cli alonzo genesis
| create
| create-staked
| create-testnet-data
| hash
)

Genesis block commands.
Expand All @@ -36,4 +35,3 @@ Available commands:
create-staked Create a staked Shelley genesis file from a genesis
template and genesis/delegation/spending keys.
create-testnet-data Create data to use for starting a testnet.
hash Compute the hash of a genesis file

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Usage: cardano-cli babbage genesis
| create
| create-staked
| create-testnet-data
| hash
)

Genesis block commands.
Expand All @@ -36,4 +35,3 @@ Available commands:
create-staked Create a staked Shelley genesis file from a genesis
template and genesis/delegation/spending keys.
create-testnet-data Create data to use for starting a testnet.
hash Compute the hash of a genesis file

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Usage: cardano-cli conway genesis
| create
| create-staked
| create-testnet-data
| hash
)

Genesis block commands.
Expand All @@ -36,4 +35,3 @@ Available commands:
create-staked Create a staked Shelley genesis file from a genesis
template and genesis/delegation/spending keys.
create-testnet-data Create data to use for starting a testnet.
hash Compute the hash of a genesis file

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Usage: cardano-cli latest genesis
| create
| create-staked
| create-testnet-data
| hash
)

Genesis block commands.
Expand All @@ -36,4 +35,3 @@ Available commands:
create-staked Create a staked Shelley genesis file from a genesis
template and genesis/delegation/spending keys.
create-testnet-data Create data to use for starting a testnet.
hash Compute the hash of a genesis file

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Usage: cardano-cli legacy genesis
| create-cardano
| create
| create-staked
| hash
)

Genesis block commands
Expand All @@ -34,4 +33,3 @@ Available commands:
and genesis/delegation/spending keys.
create-staked Create a staked Shelley genesis file from a genesis
template and genesis/delegation/spending keys.
hash Compute the hash of a genesis file

This file was deleted.

Loading

0 comments on commit e7c8634

Please sign in to comment.