@@ -81,6 +81,7 @@ import Data.ByteString qualified as BS
8181import Data.Either.Combinators (maybeToRight )
8282import Data.Maybe
8383import Data.String (IsString (.. ))
84+ import GHC.Stack (HasCallStack )
8485
8586--
8687-- Shelley payment keys
@@ -330,6 +331,8 @@ instance HasTextEnvelope (SigningKey PaymentExtendedKey) where
330331 textEnvelopeType _ = " PaymentExtendedSigningKeyShelley_ed25519_bip32"
331332
332333instance CastVerificationKeyRole PaymentExtendedKey PaymentKey where
334+ castVerificationKey
335+ :: HasCallStack => VerificationKey PaymentExtendedKey -> VerificationKey PaymentKey
333336 castVerificationKey (PaymentExtendedVerificationKey vk) =
334337 PaymentVerificationKey
335338 . Shelley. VKey
@@ -580,6 +583,7 @@ instance HasTextEnvelope (SigningKey StakeExtendedKey) where
580583 textEnvelopeType _ = " StakeExtendedSigningKeyShelley_ed25519_bip32"
581584
582585instance CastVerificationKeyRole StakeExtendedKey StakeKey where
586+ castVerificationKey :: HasCallStack => VerificationKey StakeExtendedKey -> VerificationKey StakeKey
583587 castVerificationKey (StakeExtendedVerificationKey vk) =
584588 StakeVerificationKey
585589 . Shelley. VKey
@@ -1033,6 +1037,8 @@ instance SerialiseAsBech32 (SigningKey CommitteeColdExtendedKey) where
10331037 bech32PrefixesPermitted _ = unsafeHumanReadablePartFromText <$> [" cc_cold_xsk" ]
10341038
10351039instance CastVerificationKeyRole CommitteeColdExtendedKey CommitteeColdKey where
1040+ castVerificationKey
1041+ :: HasCallStack => VerificationKey CommitteeColdExtendedKey -> VerificationKey CommitteeColdKey
10361042 castVerificationKey (CommitteeColdExtendedVerificationKey vk) =
10371043 CommitteeColdVerificationKey
10381044 . Shelley. VKey
@@ -1168,6 +1174,8 @@ instance SerialiseAsBech32 (SigningKey CommitteeHotExtendedKey) where
11681174 bech32PrefixesPermitted _ = unsafeHumanReadablePartFromText <$> [" cc_hot_xsk" ]
11691175
11701176instance CastVerificationKeyRole CommitteeHotExtendedKey CommitteeHotKey where
1177+ castVerificationKey
1178+ :: HasCallStack => VerificationKey CommitteeHotExtendedKey -> VerificationKey CommitteeHotKey
11711179 castVerificationKey (CommitteeHotExtendedVerificationKey vk) =
11721180 CommitteeHotVerificationKey
11731181 . Shelley. VKey
@@ -1307,6 +1315,8 @@ instance HasTextEnvelope (SigningKey GenesisExtendedKey) where
13071315 textEnvelopeType _ = " GenesisExtendedSigningKey_ed25519_bip32"
13081316
13091317instance CastVerificationKeyRole GenesisExtendedKey GenesisKey where
1318+ castVerificationKey
1319+ :: HasCallStack => VerificationKey GenesisExtendedKey -> VerificationKey GenesisKey
13101320 castVerificationKey (GenesisExtendedVerificationKey vk) =
13111321 GenesisVerificationKey
13121322 . Shelley. VKey
@@ -1556,6 +1566,8 @@ instance HasTextEnvelope (SigningKey GenesisDelegateExtendedKey) where
15561566 textEnvelopeType _ = " GenesisDelegateExtendedSigningKey_ed25519_bip32"
15571567
15581568instance CastVerificationKeyRole GenesisDelegateExtendedKey GenesisDelegateKey where
1569+ castVerificationKey
1570+ :: HasCallStack => VerificationKey GenesisDelegateExtendedKey -> VerificationKey GenesisDelegateKey
15591571 castVerificationKey (GenesisDelegateExtendedVerificationKey vk) =
15601572 GenesisDelegateVerificationKey
15611573 . Shelley. VKey
@@ -1966,6 +1978,8 @@ instance FromJSON (Hash StakePoolExtendedKey) where
19661978 Right h -> pure h
19671979
19681980instance CastVerificationKeyRole StakePoolExtendedKey StakePoolKey where
1981+ castVerificationKey
1982+ :: HasCallStack => VerificationKey StakePoolExtendedKey -> VerificationKey StakePoolKey
19691983 castVerificationKey (StakePoolExtendedVerificationKey vk) =
19701984 StakePoolVerificationKey
19711985 . Shelley. VKey
@@ -2225,6 +2239,7 @@ instance SerialiseAsBech32 (SigningKey DRepExtendedKey) where
22252239 bech32PrefixesPermitted _ = unsafeHumanReadablePartFromText <$> [" drep_xsk" ]
22262240
22272241instance CastVerificationKeyRole DRepExtendedKey DRepKey where
2242+ castVerificationKey :: HasCallStack => VerificationKey DRepExtendedKey -> VerificationKey DRepKey
22282243 castVerificationKey (DRepExtendedVerificationKey vk) =
22292244 DRepVerificationKey
22302245 . Shelley. VKey
0 commit comments