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

Commit

Permalink
[RCD-49] Fix unwrapped API response for /api/internal/next-update
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ committed Nov 22, 2018
1 parent edf53bb commit b1c7a5c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion wallet-new/src/Cardano/Wallet/API/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Cardano.Wallet.API.V1.Types (V1, Wallet, WalletImport)
type API = Tags '["Internal"] :>
( "next-update"
:> Summary "Version of the next update (404 if none)"
:> Get '[ValidJSON] (V1 SoftwareVersion)
:> Get '[ValidJSON] (WalletResponse (V1 SoftwareVersion))

:<|> "apply-update"
:> Summary "Apply the next available update"
Expand Down
4 changes: 2 additions & 2 deletions wallet-new/src/Cardano/Wallet/API/Internal/Handlers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ handlers w = nextUpdate w
:<|> resetWalletState w
:<|> importWallet w

nextUpdate :: PassiveWalletLayer IO -> Handler (V1 SoftwareVersion)
nextUpdate :: PassiveWalletLayer IO -> Handler (WalletResponse (V1 SoftwareVersion))
nextUpdate w = do
mUpd <- liftIO $ WalletLayer.nextUpdate w
case mUpd of
Just upd -> return upd
Just upd -> return $ single upd
Nothing -> throwError err404

applyUpdate :: PassiveWalletLayer IO -> Handler NoContent
Expand Down
2 changes: 1 addition & 1 deletion wallet-new/src/Cardano/Wallet/Client.hs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ data WalletClient m

-- Internal API
, nextUpdate
:: m (Either ClientError (V1 SoftwareVersion))
:: Resp m (V1 SoftwareVersion)
, applyUpdate
:: m (Either ClientError ())
, postponeUpdate
Expand Down

0 comments on commit b1c7a5c

Please sign in to comment.