Skip to content

Commit

Permalink
Expand upon and refactor Cardano.CLI.Shelley.Key
Browse files Browse the repository at this point in the history
  • Loading branch information
intricate committed Sep 25, 2020
1 parent 841520f commit 8783cb1
Show file tree
Hide file tree
Showing 7 changed files with 463 additions and 186 deletions.
21 changes: 1 addition & 20 deletions cardano-cli/src/Cardano/CLI/Shelley/Commands.hs
@@ -1,5 +1,4 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE UndecidableInstances #-}

-- | Shelley CLI command types
Expand Down Expand Up @@ -42,7 +41,6 @@ module Cardano.CLI.Shelley.Commands
, PoolMetaDataFile (..)
, PrivKeyFile (..)
, BlockId (..)
, VerificationKeyOrHashOrFile (..)
, WitnessSigningData (..)
) where

Expand All @@ -55,6 +53,7 @@ import Cardano.Api.Typed hiding (PoolId)

import Ouroboros.Consensus.BlockchainTime (SystemStart (..))

import Cardano.CLI.Shelley.Key (VerificationKeyOrHashOrFile)
import Cardano.CLI.Types

import Shelley.Spec.Ledger.TxBody (MIRPot)
Expand Down Expand Up @@ -442,24 +441,6 @@ newtype VerificationKeyBase64
= VerificationKeyBase64 String
deriving (Eq, Show)

-- | Either a verification key, verification key hash, or path to a
-- verification key file.
data VerificationKeyOrHashOrFile keyrole
= VerificationKeyValue !(VerificationKey keyrole)
-- ^ A verification key.
| VerificationKeyHash !(Hash keyrole)
-- ^ A verification key hash.
| VerificationKeyFilePath !VerificationKeyFile
-- ^ A path to a verification key file.
-- Note that this file hasn't been validated at all (whether it exists,
-- contains a key of the correct type, etc.)

deriving instance (Show (VerificationKey keyrole), Show (Hash keyrole))
=> Show (VerificationKeyOrHashOrFile keyrole)

deriving instance (Eq (VerificationKey keyrole), Eq (Hash keyrole))
=> Eq (VerificationKeyOrHashOrFile keyrole)

-- | Data required to construct a witness.
data WitnessSigningData
= KeyWitnessSigningData
Expand Down

0 comments on commit 8783cb1

Please sign in to comment.