Skip to content

Commit

Permalink
Add a roundtrip textual encoding test for PoolId.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Aug 13, 2020
1 parent e4136cf commit b0eb33a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/core/test/unit/Cardano/Wallet/Primitive/TypesSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import Cardano.Wallet.Primitive.Types
, FeePolicy (..)
, Hash (..)
, HistogramBar (..)
, PoolId (..)
, PoolOwner (..)
, Range (..)
, RangeBound (..)
Expand Down Expand Up @@ -218,6 +219,7 @@ spec = do
textRoundtrip $ Proxy @(Hash "Block")
textRoundtrip $ Proxy @(Hash "BlockHeader")
textRoundtrip $ Proxy @SyncTolerance
textRoundtrip $ Proxy @PoolId
textRoundtrip $ Proxy @PoolOwner

-- Extra hand-crafted tests
Expand Down Expand Up @@ -1357,6 +1359,9 @@ instance Arbitrary Word31 where
arbitrary = arbitrarySizedBoundedIntegral
shrink = shrinkIntegral

instance Arbitrary PoolId where
arbitrary = PoolId . BS.pack <$> vector 32

instance Arbitrary PoolOwner where
arbitrary = PoolOwner . BS.pack <$> vector 32

Expand Down

0 comments on commit b0eb33a

Please sign in to comment.