Skip to content

Commit

Permalink
Revert use of decodeErrorInfo for WALLETS_SIGNATURES_03.
Browse files Browse the repository at this point in the history
This particular test happens to use `rawRequest` instead of `request`.
Whereas the `request` function attempts to decode the response into a
JSON `Value`, the `rawRequest` function does not perform any decoding.

This causes the subsequent `decodeErrorInfo` to fail with:

```
  uncaught exception: ErrorCall
   decodeErrorInfo: Expected a 'ClientError', but encountered something else: Left (RawClientError "{\"code\":\"no_such_wallet\",\"info\":{\"wallet_id\":\"acab1951ad1ef5808eb9756b02d1ff85caf0e702\"},\"message\":\"I couldn't find a wallet with the given id: acab1951ad1ef5808eb9756b02d1ff85caf0e702\"}")
   CallStack (from HasCallStack):
     error, called at framework/Test/Integration/Framework/DSL.hs:742:13 in cardano-wallet-integration-2024.5.5-KhWmuWPIqBp7pTemTBE3I2-framework:Test.Integration.Framework.DSL
     decodeErrorInfo, called at scenarios/Test/Integration/Scenario/API/Shelley/Wallets.hs:1495:9 in cardano-wallet-integration-2024.5.5-AcHGWrd1jBGKoKhY01VJRG-scenarios:Test.Integration.Scenario.API.Shelley.Wallets
```
  • Loading branch information
jonathanknowles committed May 23, 2024
1 parent 5253bc6 commit 7050122
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ import Test.Integration.Framework.TestData
( arabicWalletName
, errMsg403WrongMnemonic
, errMsg403WrongPass
, errMsg404NoWallet
, errMsg406
, errMsg415
, kanjiWalletName
Expand Down Expand Up @@ -1489,11 +1490,12 @@ spec = describe "SHELLEY_WALLETS" $ do
(Headers [(HTTP.hAccept, "*/*"), (HTTP.hContentType, "application/json")])
(Json payload)

-- TODO: ADP-3306
-- Use `expectErrorInfo` instead of `expectErrorMessage` here:
verify r
[ expectResponseCode HTTP.status404
, expectErrorMessage (errMsg404NoWallet $ w ^. walletId)
]
decodeErrorInfo r `shouldBe`
NoSuchWallet (ApiErrorNoSuchWallet (w ^. #id))

it "BYRON_WALLETS_UTXO -\
\ Cannot show Byron wal utxo with shelley ep (404)" $ \ctx -> runResourceT $ do
Expand Down

0 comments on commit 7050122

Please sign in to comment.