Skip to content

Commit 037327e

Browse files
committed
Add missing CastVerificationKeyRole StakePoolExtendedKey StakePoolKey instance
1 parent b317be5 commit 037327e

File tree

1 file changed

+12
-0
lines changed
  • cardano-api/src/Cardano/Api/Internal/Keys

1 file changed

+12
-0
lines changed

cardano-api/src/Cardano/Api/Internal/Keys/Shelley.hs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,6 +1906,18 @@ instance SerialiseAsBech32 (SigningKey StakePoolExtendedKey) where
19061906
bech32PrefixFor _ = "pool_xsk"
19071907
bech32PrefixesPermitted _ = ["pool_xsk"]
19081908

1909+
instance CastVerificationKeyRole StakePoolExtendedKey StakePoolKey where
1910+
castVerificationKey (StakePoolExtendedVerificationKey vk) =
1911+
StakePoolVerificationKey
1912+
. Shelley.VKey
1913+
. fromMaybe impossible
1914+
. Crypto.rawDeserialiseVerKeyDSIGN
1915+
. Crypto.HD.xpubPublicKey
1916+
$ vk
1917+
where
1918+
impossible =
1919+
error "castVerificationKey (StakePoolKey): byron and shelley key sizes do not match!"
1920+
19091921
--
19101922
-- DRep keys
19111923
--

0 commit comments

Comments
 (0)