Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the return type of migrateByronWallet to be a list of transactions. #837

Merged
merged 1 commit into from
Oct 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lib/core/src/Cardano/Wallet/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ import Servant.API
, NoContent
, OctetStream
, PostAccepted
, PostNoContent
, Put
, PutNoContent
, QueryParam
Expand All @@ -125,10 +124,9 @@ type CompatibilityApi t =
:<|> GetByronWallet
:<|> GetByronWalletMigrationInfo
:<|> ListByronWallets
:<|> MigrateByronWallet
:<|> MigrateByronWallet t
:<|> PostByronWallet


{-------------------------------------------------------------------------------
Addresses

Expand Down Expand Up @@ -293,13 +291,13 @@ type ListByronWallets = "byron"
:> Get '[JSON] [ApiByronWallet]

-- | https://input-output-hk.github.io/cardano-wallet/api/#operation/migrateByronWallet
type MigrateByronWallet = "byron"
type MigrateByronWallet t = "byron"
:> "wallets"
:> Capture "sourceWalletId" (ApiT WalletId)
:> "migrate"
:> Capture "targetWalletId" (ApiT WalletId)
:> ReqBody '[JSON] ApiMigrateByronWalletData
:> PostNoContent '[Any] NoContent
:> PostAccepted '[JSON] [ApiTransaction t]

-- | https://input-output-hk.github.io/cardano-wallet/api/#operation/postByronWallet
type PostByronWallet = "byron"
Expand Down
2 changes: 1 addition & 1 deletion lib/core/src/Cardano/Wallet/Api/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ migrateByronWallet
-> ApiT WalletId
-- ^ Target wallet (new-style)
-> ApiMigrateByronWalletData
-> Handler NoContent
-> Handler [ApiTransaction t]
migrateByronWallet _rndCtx _seqCtx _sourceWid _targetWid _migrateData =
throwError err501

Expand Down
7 changes: 5 additions & 2 deletions specifications/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -821,8 +821,11 @@ x-responsesMigrateByronWallet: &responsesMigrateByronWallet
<<: *responsesErr404
<<: *responsesErr405
<<: *responsesErr406
204:
description: No Content
200:
description: Ok
schema:
type: array
items: *ApiTransaction

x-responsesDeleteWallet: &responsesDeleteWallet
<<: *responsesErr404
Expand Down