From 433ea9bba7359cf0536b2edda4b1ce206f423b8f Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Tue, 25 Aug 2020 11:28:40 +0200 Subject: [PATCH] Add roundtrip property test for {encode,decode}PoolIdBech32 --- lib/core/test/unit/Cardano/Wallet/Primitive/TypesSpec.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/core/test/unit/Cardano/Wallet/Primitive/TypesSpec.hs b/lib/core/test/unit/Cardano/Wallet/Primitive/TypesSpec.hs index e5f87117023..a744b3d11e4 100644 --- a/lib/core/test/unit/Cardano/Wallet/Primitive/TypesSpec.hs +++ b/lib/core/test/unit/Cardano/Wallet/Primitive/TypesSpec.hs @@ -86,6 +86,8 @@ import Cardano.Wallet.Primitive.Types , WalletName (..) , balance , computeUtxoStatistics + , decodePoolIdBech32 + , encodePoolIdBech32 , excluding , isAfterRange , isBeforeRange @@ -228,6 +230,10 @@ spec = do toText <$> fromText @(Hash "Account") text `shouldBe` Right text + it "Can roundtrip {decode,encode}PoolIdBech32" $ + withMaxSuccess 1000 $ property $ \(pid :: PoolId) -> + decodePoolIdBech32 (encodePoolIdBech32 pid) === Right pid + describe "Buildable" $ do it "WalletId" $ do let mw = someDummyMnemonic (Proxy @12)