Skip to content

Commit

Permalink
Use associated type family for payment key index
Browse files Browse the repository at this point in the history
Co-authored-by: Mateusz Galazyn <[email protected]>
  • Loading branch information
palas and carbolymer authored Nov 18, 2024
1 parent 3192ab8 commit 6f196f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cardano-api/internal/Cardano/Api/Keys/Mnemonics.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ instance Error MnemonicToSigningKeyError where
prettyError (InvalidAccountNumberError accNo) = "Invalid account number: " <> pretty accNo
prettyError (InvalidPaymentKeyNoError keyNo) = "Invalid payment key number: " <> pretty keyNo

class ExtendedSigningKeyRole keyrole indexType | keyrole -> indexType where
class ExtendedSigningKeyRole keyrole where
type EskIndex keyrole
-- | Derive an extended private key of the keyrole from an account extended private key
deriveSigningKeyFromAccount
:: AsType keyrole
-- ^ Type of the extended signing key to generate.
-> Shelley 'AccountK XPrv
-- ^ The account extended private key from which to derivate the private key for the keyrole.
-> indexType
-> EskIndex keyrole
-- ^ The payment key number in the derivation path (as 'Word32') if applicable for
-- the given key role, otherwise '()'. First key is 0.
-> Either Word32 (SigningKey keyrole)
Expand Down

0 comments on commit 6f196f5

Please sign in to comment.