File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -184,24 +184,24 @@ instance Arbitrary2 Entry where
184184--
185185-- Also useful for failing tests that have keys as inputs, because the printed
186186-- 'WithSerialised' values will show both keys and their serialised form.
187- data WithSerialised k = TestKey k SerialisedKey
187+ data WithSerialised k = WithSerialised k SerialisedKey
188188 deriving stock Show
189189
190190instance Eq k => Eq (WithSerialised k ) where
191- TestKey k1 _ == TestKey k2 _ = k1 == k2
191+ WithSerialised k1 _ == WithSerialised k2 _ = k1 == k2
192192
193193instance Ord k => Ord (WithSerialised k ) where
194- TestKey k1 _ `compare` TestKey k2 _ = k1 `compare` k2
194+ WithSerialised k1 _ `compare` WithSerialised k2 _ = k1 `compare` k2
195195
196196instance (Arbitrary k , SerialiseKey k ) => Arbitrary (WithSerialised k ) where
197197 arbitrary = do
198198 x <- arbitrary
199- pure $ TestKey x (serialiseKey x)
200- shrink (TestKey k _) = [TestKey k' (serialiseKey k') | k' <- shrink k]
199+ pure $ WithSerialised x (serialiseKey x)
200+ shrink (WithSerialised k _) = [WithSerialised k' (serialiseKey k') | k' <- shrink k]
201201
202202instance SerialiseKey k => SerialiseKey (WithSerialised k ) where
203- serialiseKey (TestKey _ (SerialisedKey bytes)) = bytes
204- deserialiseKey bytes = TestKey (S.Class. deserialiseKey bytes) (SerialisedKey bytes)
203+ serialiseKey (WithSerialised _ (SerialisedKey bytes)) = bytes
204+ deserialiseKey bytes = WithSerialised (S.Class. deserialiseKey bytes) (SerialisedKey bytes)
205205
206206{- ------------------------------------------------------------------------------
207207 Other number newtypes
You can’t perform that action at this time.
0 commit comments