Skip to content

Commit

Permalink
Merge #4048 #4137
Browse files Browse the repository at this point in the history
4048: Expose Key interface in Cardano.Api.Shelley r=ch1bo a=ch1bo

Sorry for this unsolicited PR, it is *not* crucial for us, but we wanted to get also your feedback on:

In the Hydra project we are using the cardano-api quite heavily and thought we could distinguish Hydra key types using the same framework, but just with a new `Hydra` key role. 

Unfortunately it was not possible because some of the type class definition was not exported.

This PR exposes the full type class to be able to define instances of it and having a `Hydra` key role, this yields `SigningKey Hydra` and `VerificationKey Hydra` key types.

See also this PR: cardano-scaling/hydra#398

4137: Give myself and John permission to merge any PR r=Jimbo4350 a=Jimbo4350



Co-authored-by: Sebastian Nagel <[email protected]>
Co-authored-by: Jordan Millar <[email protected]>
  • Loading branch information
3 people authored Jul 5, 2022
3 parents 3fca5ff + 20e6e21 + 8f0a350 commit 0cd6878
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 45 deletions.
68 changes: 34 additions & 34 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Technical writers
doc @fsancheziohk @nahern @olgahryniuk
README.* @fsancheziohk @nahern @olgahryniuk
cardano-cli/README.md @fsancheziohk @nahern @olgahryniuk
doc @Jimbo4350 @newhoggy @fsancheziohk @nahern @olgahryniuk
README.* @Jimbo4350 @newhoggy @fsancheziohk @nahern @olgahryniuk
cardano-cli/README.md @Jimbo4350 @newhoggy @fsancheziohk @nahern @olgahryniuk

# Release manager added for notification on dependency updates
cabal.project @LaurenceIO
cabal.project @Jimbo4350 @newhoggy @LaurenceIO

# General reviewers per PR
# Duncan Jordan Erik John Jared
Expand All @@ -19,33 +19,33 @@ cabal.project @LaurenceIO
doc @docs-access
README.* @docs-access

bench/tx-generator @deepfire @MarcFontaine
bench @deepfire @denisshevchenko @jutaro @MarcFontaine @mgmeier @cleverca22
cardano-tracer @deepfire @denisshevchenko
nix/workbench @deepfire @denisshevchenko @jutaro @MarcFontaine @mgmeier
trace-dispatcher @deepfire @denisshevchenko @jutaro @mgmeier
trace-forward @deepfire @denisshevchenko @jutaro @mgmeier
trace-resources @deepfire @denisshevchenko @jutaro @mgmeier
Makefile @deepfire @mgmeier
*.mk @deepfire @mgmeier

.buildkite @devops
.github @devops
ci @devops
configuration @devops
nix @devops
*.nix @devops
flake.lock @devops
bors.toml @devops
docker-compose.yml @devops
cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs @devops @coot
cardano-node/src/Cardano/Node/Configuration/Logging.hs @devops
cardano-node/src/Cardano/Node/Configuration/Socket.hs @devops
cardano-node/src/Cardano/Node/Tracing @deepfire @denisshevchenko @jutaro
cardano-node/src/Cardano/Node/Tracing/Tracers/Diffusion.hs @deepfire @denisshevchenko @jutaro @coot
cardano-node/src/Cardano/Node/Tracing/Tracers/NodeToClient.hs @deepfire @denisshevchenko @jutaro @coot
cardano-node/src/Cardano/Node/Tracing/Tracers/NodeToServer.hs @deepfire @denisshevchenko @jutaro @coot
cardano-node/src/Cardano/Node/Tracing/Tracers/NonP2P.hs @deepfire @denisshevchenko @jutaro @coot
cardano-node/src/Cardano/Node/Tracing/Tracers/P2P.hs @deepfire @denisshevchenko @jutaro @coot
cardano-node/src/Cardano/Node/Tracing/Tracers/Peer.hs @deepfire @denisshevchenko @jutaro @coot
cardano-node/src/Cardano/Node/Run.hs @devops
bench/tx-generator @Jimbo4350 @newhoggy @deepfire @MarcFontaine
bench @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @MarcFontaine @mgmeier @cleverca22
cardano-tracer @Jimbo4350 @newhoggy @deepfire @denisshevchenko
nix/workbench @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @MarcFontaine @mgmeier
trace-dispatcher @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @mgmeier
trace-forward @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @mgmeier
trace-resources @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @mgmeier
Makefile @Jimbo4350 @newhoggy @deepfire @mgmeier
*.mk @Jimbo4350 @newhoggy @deepfire @mgmeier

.buildkite @Jimbo4350 @newhoggy @devops
.github @Jimbo4350 @newhoggy @devops
ci @Jimbo4350 @newhoggy @devops
configuration @Jimbo4350 @newhoggy @devops
nix @Jimbo4350 @newhoggy @devops
*.nix @Jimbo4350 @newhoggy @devops
flake.lock @Jimbo4350 @newhoggy @devops
bors.toml @Jimbo4350 @newhoggy @devops
docker-compose.yml @Jimbo4350 @newhoggy @devops
cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs @Jimbo4350 @newhoggy @devops @coot
cardano-node/src/Cardano/Node/Configuration/Logging.hs @Jimbo4350 @newhoggy @devops
cardano-node/src/Cardano/Node/Configuration/Socket.hs @Jimbo4350 @newhoggy @devops
cardano-node/src/Cardano/Node/Tracing @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro
cardano-node/src/Cardano/Node/Tracing/Tracers/Diffusion.hs @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @coot
cardano-node/src/Cardano/Node/Tracing/Tracers/NodeToClient.hs @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @coot
cardano-node/src/Cardano/Node/Tracing/Tracers/NodeToServer.hs @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @coot
cardano-node/src/Cardano/Node/Tracing/Tracers/NonP2P.hs @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @coot
cardano-node/src/Cardano/Node/Tracing/Tracers/P2P.hs @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @coot
cardano-node/src/Cardano/Node/Tracing/Tracers/Peer.hs @Jimbo4350 @newhoggy @deepfire @denisshevchenko @jutaro @coot
cardano-node/src/Cardano/Node/Run.hs @Jimbo4350 @newhoggy @devops
11 changes: 2 additions & 9 deletions cardano-api/src/Cardano/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,12 @@ module Cardano.Api (
AsType(..),
-- * Cryptographic key interface
-- $keys
Key,
VerificationKey,
Key(..),
SigningKey(..),
getVerificationKey,
verificationKeyHash,
VerificationKey(..),
castVerificationKey,
castSigningKey,

-- ** Generating keys
generateSigningKey,
deterministicSigningKey,
deterministicSigningKeySeedSize,

-- ** Hashes
-- | In Cardano most keys are identified by their hash, and hashes are
Expand Down Expand Up @@ -686,7 +680,6 @@ import Cardano.Api.IPC
import Cardano.Api.IPC.Monad
import Cardano.Api.Key
import Cardano.Api.KeysByron
import Cardano.Api.KeysPraos
import Cardano.Api.KeysShelley
import Cardano.Api.LedgerEvent
import Cardano.Api.LedgerState
Expand Down
2 changes: 2 additions & 0 deletions cardano-api/src/Cardano/Api/Shelley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module Cardano.Api.Shelley

-- * Cryptographic key interface
-- $keys
Key(..),
VerificationKey(..),
SigningKey(..),

Expand Down Expand Up @@ -230,6 +231,7 @@ import Cardano.Api.Eras
import Cardano.Api.IPC
import Cardano.Api.InMode
import Cardano.Api.KeysPraos
import Cardano.Api.KeysByron
import Cardano.Api.KeysShelley
import Cardano.Api.LedgerState
import Cardano.Api.NetworkId
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/Byron/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import qualified Cardano.Crypto.Hashing as Crypto
import qualified Cardano.Crypto.Signing as Crypto

import Cardano.Api hiding (UpdateProposal, GenesisParameters)
import Cardano.Api.Byron (SomeByronSigningKey (..), Tx (..), VerificationKey (..))
import Cardano.Api.Byron (SomeByronSigningKey (..), Tx (..))

import Ouroboros.Consensus.Byron.Ledger (ByronBlock)
import Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr)
Expand Down
1 change: 0 additions & 1 deletion cardano-cli/src/Cardano/CLI/Shelley/Run/Key.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import qualified Cardano.Crypto.Wallet as Crypto
import qualified Cardano.Ledger.Keys as Shelley

import Cardano.Api
import Cardano.Api.Byron hiding (SomeByronSigningKey (..))
import qualified Cardano.Api.Byron as ByronApi
import Cardano.Api.Crypto.Ed25519Bip32 (xPrvFromBytes)
import Cardano.Api.Shelley
Expand Down

0 comments on commit 0cd6878

Please sign in to comment.