From 55868d239035c22856196df32c1cff3843fa9051 Mon Sep 17 00:00:00 2001 From: Pawel Jakubas Date: Mon, 5 Aug 2024 18:36:32 +0200 Subject: [PATCH] code polishing --- .../Wallet/Primitive/Types/MetadataEncryption.hs | 4 ++-- .../Primitive/Types/MetadataEncryptionSpec.hs | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/primitive/lib/Cardano/Wallet/Primitive/Types/MetadataEncryption.hs b/lib/primitive/lib/Cardano/Wallet/Primitive/Types/MetadataEncryption.hs index 6812430139e..b719d92b236 100644 --- a/lib/primitive/lib/Cardano/Wallet/Primitive/Types/MetadataEncryption.hs +++ b/lib/primitive/lib/Cardano/Wallet/Primitive/Types/MetadataEncryption.hs @@ -63,10 +63,10 @@ import Data.ByteString ( ByteString ) import Data.Maybe - ( fromMaybe + ( formJust + , fromMaybe , isJust , isNothing - , fromJust , mapMaybe ) import Data.Text diff --git a/lib/primitive/test/spec/Cardano/Wallet/Primitive/Types/MetadataEncryptionSpec.hs b/lib/primitive/test/spec/Cardano/Wallet/Primitive/Types/MetadataEncryptionSpec.hs index ab3ff045b9b..b7d56203bdd 100644 --- a/lib/primitive/test/spec/Cardano/Wallet/Primitive/Types/MetadataEncryptionSpec.hs +++ b/lib/primitive/test/spec/Cardano/Wallet/Primitive/Types/MetadataEncryptionSpec.hs @@ -479,16 +479,18 @@ instance Arbitrary TestingSetup where prop_roundtrip :: TestingSetup -> Property prop_roundtrip (TestingSetup payload' pwd' _ salt') = do - ((mapLeft (const ErrMissingValidEncryptionPayload) $ - toMetadataEncrypted pwd' payload' (Just salt')) >>= - fromMetadataEncrypted pwd') + (mapLeft + (const ErrMissingValidEncryptionPayload) + (toMetadataEncrypted pwd' payload' (Just salt')) + >>= fromMetadataEncrypted pwd') === Right payload' prop_passphrase :: TestingSetup -> Expectation prop_passphrase (TestingSetup payload' pwd1 pwd2 salt') = do - ((mapLeft (const ErrMissingValidEncryptionPayload) $ - toMetadataEncrypted pwd1 payload' (Just salt')) >>= - fromMetadataEncrypted pwd2) + (mapLeft + (const ErrMissingValidEncryptionPayload) + (toMetadataEncrypted pwd1 payload' (Just salt')) + >>= fromMetadataEncrypted pwd2) `shouldSatisfy` isLeft prop_structure_after_enc :: TestingSetup -> Expectation