From 6f196f5c8343bfa05024f8def6cd35fcf8c48840 Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Mon, 18 Nov 2024 10:55:57 +0100 Subject: [PATCH] Use associated type family for payment key index Co-authored-by: Mateusz Galazyn <228866+carbolymer@users.noreply.github.com> --- cardano-api/internal/Cardano/Api/Keys/Mnemonics.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cardano-api/internal/Cardano/Api/Keys/Mnemonics.hs b/cardano-api/internal/Cardano/Api/Keys/Mnemonics.hs index 8d5d3c090..3ae6d1ed2 100644 --- a/cardano-api/internal/Cardano/Api/Keys/Mnemonics.hs +++ b/cardano-api/internal/Cardano/Api/Keys/Mnemonics.hs @@ -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)