From 67f7b6a6323cf56feaa3fb062e4c3eb0d94f90ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jann=20M=C3=BCller?= Date: Tue, 28 Sep 2021 16:34:19 +0200 Subject: [PATCH] Delete XPub constructor --- plutus-contract/src/Wallet/Emulator/MultiAgent.hs | 1 - plutus-contract/src/Wallet/Emulator/Wallet.hs | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/plutus-contract/src/Wallet/Emulator/MultiAgent.hs b/plutus-contract/src/Wallet/Emulator/MultiAgent.hs index 39926f46dc3..8baf4f08a0a 100644 --- a/plutus-contract/src/Wallet/Emulator/MultiAgent.hs +++ b/plutus-contract/src/Wallet/Emulator/MultiAgent.hs @@ -235,7 +235,6 @@ makeLenses ''EmulatorState walletState :: Wallet -> Lens' EmulatorState Wallet.WalletState walletState wallet@(Wallet (MockWallet privKey)) = walletStates . at wallet . anon (Wallet.emptyWalletState privKey) (const False) -walletState (Wallet (XPubWallet _)) = error "XPub Wallets not supported in emulator" walletState (Wallet (CardanoWallet _)) = error "Cardano wallets not supported in emulator" -- | Get the blockchain as a list of blocks, starting with the oldest (genesis) diff --git a/plutus-contract/src/Wallet/Emulator/Wallet.hs b/plutus-contract/src/Wallet/Emulator/Wallet.hs index 5093e290fa5..a6de6ebdbe1 100644 --- a/plutus-contract/src/Wallet/Emulator/Wallet.hs +++ b/plutus-contract/src/Wallet/Emulator/Wallet.hs @@ -99,7 +99,6 @@ deriving anyclass instance OpenApi.ToSchema Cardano.Wallet.WalletId data WalletId = MockWallet Crypto.XPrv - | XPubWallet Crypto.XPub | CardanoWallet Cardano.Wallet.WalletId deriving (Eq, Ord, Generic) deriving anyclass (ToJSONKey) @@ -126,7 +125,6 @@ deriving anyclass instance OpenApi.ToSchema WalletId toBase16 :: WalletId -> T.Text toBase16 (MockWallet xprv) = encodeByteString $ Crypto.unXPrv xprv -toBase16 (XPubWallet xpub) = encodeByteString $ Crypto.unXPub xpub toBase16 (CardanoWallet wllt) = toText wllt fromBase16 :: T.Text -> Either String WalletId @@ -134,14 +132,12 @@ fromBase16 s = bimap show CardanoWallet (fromText s) <|> decode where decode = do bs <- tryDecode s case BS.length bs of - 64 -> XPubWallet <$> Crypto.xpub bs 128 -> MockWallet <$> Crypto.xprv bs - _ -> Left "fromBase16 error: bytestring length should be 64 or 128" + _ -> Left "fromBase16 error: bytestring length should be 128" -- | Get a wallet's extended public key walletXPub :: Wallet -> Maybe Crypto.XPub walletXPub (Wallet (MockWallet xprv)) = Just (Crypto.toXPub xprv) -walletXPub (Wallet (XPubWallet xpub)) = Just xpub walletXPub _ = Nothing -- | Get a wallet's public key. @@ -152,7 +148,6 @@ walletPubKey = fmap Crypto.xPubToPublicKey . walletXPub walletPubKeyHash :: Wallet -> PubKeyHash walletPubKeyHash = \case Wallet (MockWallet xprv) -> pubKeyHash $ Crypto.xPubToPublicKey $ Crypto.toXPub xprv - Wallet (XPubWallet xpub) -> pubKeyHash $ Crypto.xPubToPublicKey xpub Wallet (CardanoWallet (Cardano.Wallet.WalletId i)) -> PubKeyHash $ PlutusTx.toBuiltin @ByteString $ convert i -- | Get a wallet's address.