Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the private to the wallet state.
- Loading branch information
Showing
8 changed files
with
108 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
lib/wallet/src/Cardano/Wallet/Primitive/Types/Credentials.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE StandaloneDeriving #-} | ||
{-# LANGUAGE UndecidableInstances #-} | ||
|
||
module Cardano.Wallet.Primitive.Types.Credentials | ||
( Credentials (..) | ||
, PrivateKey | ||
, HashedCredentials | ||
, ClearCredentials) where | ||
|
||
import Prelude | ||
|
||
|
||
import Cardano.Address.Derivation | ||
( XPrv ) | ||
import Cardano.Wallet.Address.Derivation | ||
( Depth (RootK) ) | ||
import Cardano.Wallet.Primitive.Passphrase.Types | ||
( Passphrase, PassphraseHash ) | ||
|
||
type PrivateKey k = k 'RootK XPrv | ||
|
||
-- | A 'PrivateKey' for a given 'KeyFlavor'. | ||
data Credentials k pw = Credentials | ||
{ credentialsKey :: PrivateKey k | ||
, credentialsPassword :: pw | ||
} | ||
|
||
deriving instance (Eq (PrivateKey k), Eq pw) => Eq (Credentials k pw) | ||
deriving instance (Show (PrivateKey k), Show pw) => Show (Credentials k pw) | ||
|
||
type HashedCredentials k = Credentials k PassphraseHash | ||
|
||
type ClearCredentials k = Credentials k (Passphrase "encryption") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.