Skip to content

Commit

Permalink
[ADP-3306] Fix call to dataTypeConstrs in FromJSON instance for `…
Browse files Browse the repository at this point in the history
…SchemaApiErrorInfo`. (#4598)

This PR makes a small fix for #4597.

## Issue

ADP-3306
  • Loading branch information
paweljakubas authored May 20, 2024
2 parents 680bfbf + 0d455fc commit ee5c073
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/unit/test/unit/Cardano/Wallet/Api/TypesSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,8 @@ data SchemaApiErrorInfo = SchemaApiErrorInfo
instance FromJSON SchemaApiErrorInfo where
parseJSON = withObject "SchemaApiErrorInfo" $ \o -> do
let constructors :: [String] =
showConstr <$> dataTypeConstrs (dataTypeOf NoSuchWallet)
showConstr <$>
dataTypeConstrs (dataTypeOf (undefined :: ApiErrorInfo))
vals :: [Either String Yaml.Value] <-
forM constructors $ \c ->
maybe (Left c) Right <$> o .:? Aeson.fromString (toSchemaName c)
Expand Down

0 comments on commit ee5c073

Please sign in to comment.