Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit b1c7a5c

Browse files
committed
[RCD-49] Fix unwrapped API response for /api/internal/next-update
1 parent edf53bb commit b1c7a5c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

wallet-new/src/Cardano/Wallet/API/Internal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Cardano.Wallet.API.V1.Types (V1, Wallet, WalletImport)
1414
type API = Tags '["Internal"] :>
1515
( "next-update"
1616
:> Summary "Version of the next update (404 if none)"
17-
:> Get '[ValidJSON] (V1 SoftwareVersion)
17+
:> Get '[ValidJSON] (WalletResponse (V1 SoftwareVersion))
1818

1919
:<|> "apply-update"
2020
:> Summary "Apply the next available update"

wallet-new/src/Cardano/Wallet/API/Internal/Handlers.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ handlers w = nextUpdate w
1919
:<|> resetWalletState w
2020
:<|> importWallet w
2121

22-
nextUpdate :: PassiveWalletLayer IO -> Handler (V1 SoftwareVersion)
22+
nextUpdate :: PassiveWalletLayer IO -> Handler (WalletResponse (V1 SoftwareVersion))
2323
nextUpdate w = do
2424
mUpd <- liftIO $ WalletLayer.nextUpdate w
2525
case mUpd of
26-
Just upd -> return upd
26+
Just upd -> return $ single upd
2727
Nothing -> throwError err404
2828

2929
applyUpdate :: PassiveWalletLayer IO -> Handler NoContent

wallet-new/src/Cardano/Wallet/Client.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ data WalletClient m
150150

151151
-- Internal API
152152
, nextUpdate
153-
:: m (Either ClientError (V1 SoftwareVersion))
153+
:: Resp m (V1 SoftwareVersion)
154154
, applyUpdate
155155
:: m (Either ClientError ())
156156
, postponeUpdate

0 commit comments

Comments
 (0)