Skip to content

Commit

Permalink
Merge #837
Browse files Browse the repository at this point in the history
837: Change the return type of `migrateByronWallet` to be a list of transactions. r=KtorZ a=jonathanknowles

# Issue Number

#779 

# Overview

The result of migrating funds from a Byron wallet to a new-style wallet will be the creation of _one or more_ transactions. Therefore, it makes sense to report this set of transactions as the result of the `migrateByronWallet` call.

This PR merely changes the return type of the call, in order to unblock testing work.

Further PRs will actually implement this call.


Co-authored-by: Jonathan Knowles <[email protected]>
  • Loading branch information
iohk-bors[bot] and jonathanknowles authored Oct 16, 2019
2 parents 9b13957 + f3d250a commit 2a17713
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
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

0 comments on commit 2a17713

Please sign in to comment.