6
6
{-# LANGUAGE GADTs #-}
7
7
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
8
8
{-# LANGUAGE InstanceSigs #-}
9
- {-# LANGUAGE LambdaCase #-}
10
9
{-# LANGUAGE MultiParamTypeClasses #-}
11
10
{-# LANGUAGE RankNTypes #-}
12
11
{-# LANGUAGE ScopedTypeVariables #-}
@@ -61,7 +60,6 @@ import Cardano.Api.Internal.SerialiseRaw
61
60
import Cardano.Api.Internal.SerialiseTextEnvelope
62
61
import Cardano.Api.Internal.SerialiseUsing
63
62
64
- import Cardano.Binary (DecoderError (DecoderErrorUnknownTag ), cborError )
65
63
import Cardano.Crypto.DSIGN.Class qualified as Crypto
66
64
import Cardano.Crypto.Hash.Class qualified as Crypto
67
65
import Cardano.Crypto.Seed qualified as Crypto
@@ -70,8 +68,6 @@ import Cardano.Ledger.Crypto (StandardCrypto)
70
68
import Cardano.Ledger.Crypto qualified as Shelley (DSIGN )
71
69
import Cardano.Ledger.Keys qualified as Shelley
72
70
73
- import Codec.CBOR.Decoding (Decoder , TokenType (TypeListLen ), decodeListLenOf , peekTokenType )
74
- import Codec.CBOR.Encoding (Encoding , encodeListLen )
75
71
import Data.Aeson.Types
76
72
( ToJSONKey (.. )
77
73
, toJSONKeyText
@@ -83,7 +79,6 @@ import Data.ByteString qualified as BS
83
79
import Data.Either.Combinators (maybeToRight )
84
80
import Data.Maybe
85
81
import Data.String (IsString (.. ))
86
- import Data.Word (Word8 )
87
82
88
83
--
89
84
-- Shelley payment keys
@@ -1681,27 +1676,6 @@ data AnyStakePoolVerificationKey
1681
1676
| AnyStakePoolExtendedVerificationKey (VerificationKey StakePoolExtendedKey )
1682
1677
deriving (Show , Eq )
1683
1678
1684
- instance ToCBOR AnyStakePoolVerificationKey where
1685
- toCBOR :: AnyStakePoolVerificationKey -> Encoding
1686
- toCBOR (AnyStakePoolNormalVerificationKey vk) =
1687
- encodeListLen 2 <> toCBOR (0 :: Word8 ) <> toCBOR vk
1688
- toCBOR (AnyStakePoolExtendedVerificationKey vk) =
1689
- encodeListLen 2 <> toCBOR (1 :: Word8 ) <> toCBOR vk
1690
-
1691
- instance FromCBOR AnyStakePoolVerificationKey where
1692
- fromCBOR :: Decoder s AnyStakePoolVerificationKey
1693
- fromCBOR =
1694
- peekTokenType >>= \ case
1695
- TypeListLen ->
1696
- decodeListLenOf 2 >> do
1697
- tag <- fromCBOR
1698
- case tag of
1699
- 0 -> AnyStakePoolNormalVerificationKey <$> fromCBOR
1700
- 1 -> AnyStakePoolExtendedVerificationKey <$> fromCBOR
1701
- _ -> cborError $ DecoderErrorUnknownTag " AnyStakePoolVerificationKey" tag
1702
- -- This case is for backwards compatibility (with CBOR encoding that doesn't support extended keys)
1703
- _ -> AnyStakePoolNormalVerificationKey <$> fromCBOR
1704
-
1705
1679
anyStakePoolVerificationKeyHash :: AnyStakePoolVerificationKey -> Hash StakePoolKey
1706
1680
anyStakePoolVerificationKeyHash (AnyStakePoolNormalVerificationKey vk) = verificationKeyHash vk
1707
1681
anyStakePoolVerificationKeyHash (AnyStakePoolExtendedVerificationKey vk) =
0 commit comments