diff --git a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/Serialization.hs b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/Serialization.hs index e6d72c160cb..8589271eaa1 100644 --- a/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/Serialization.hs +++ b/shelley/chain-and-ledger/executable-spec/src/Shelley/Spec/Ledger/Serialization.hs @@ -175,7 +175,7 @@ decodeCollectionWithLen lenOrIndef el = do Nothing -> loop (0,[]) (not <$> decodeBreakOr) el where loop (n,acc) condition action = condition >>= \case - False -> pure (n,acc) + False -> pure (n,reverse acc) True -> action >>= \v -> loop (n+1, (v:acc)) condition action rationalToCBOR :: Rational -> Encoding