Skip to content

Commit

Permalink
Create "migrations/plan" endpoint for creating migration plans.
Browse files Browse the repository at this point in the history
The migration planning endpoint will need to accept some data: the set
of addresses to which the wallet balance should be migrated. Without a
set of addresses, it's impossible to construct the coin selections
required for a migration plan, as every coin selection output must have
an address: these can only be provided by the caller.

However, the "migrateByronWallet" and "migrateShelleyWallet" operations
at the "migrations" endpoint already accept POST data.

We need a way to discriminate between the following operations:

1. Creating a plan.
2. Creating a plan and executing it immediately.

Assuming both types of operation require data to be POSTed, this means
we need different endpoint paths.
  • Loading branch information
jonathanknowles committed May 3, 2021
1 parent efdd786 commit 20a6ab4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/core/src/Cardano/Wallet/Api.hs
Expand Up @@ -518,6 +518,7 @@ type MigrateShelleyWallet n = "wallets"
type GetShelleyWalletMigrationInfo n = "wallets"
:> Capture "walletId" (ApiT WalletId)
:> "migrations"
:> "plan"
:> Get '[JSON] (ApiWalletMigrationInfo n)

{-------------------------------------------------------------------------------
Expand Down Expand Up @@ -800,6 +801,7 @@ type MigrateByronWallet n = "byron-wallets"
type GetByronWalletMigrationInfo n = "byron-wallets"
:> Capture "walletId" (ApiT WalletId)
:> "migrations"
:> "plan"
:> Get '[JSON] (ApiWalletMigrationInfo n)

{-------------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions specifications/api/swagger.yaml
Expand Up @@ -4601,6 +4601,7 @@ paths:
schema: *ApiShelleyWalletMigrationPostData
responses: *responsesMigrateWallet

/wallets/{walletId}/migrations/plan:
get:
operationId: getShelleyWalletMigrationInfo
tags: ["Migrations"]
Expand Down Expand Up @@ -5005,6 +5006,7 @@ paths:
schema: *ApiByronWalletMigrationPostData
responses: *responsesMigrateWallet

/byron-wallets/{walletId}/migrations/plan:
get:
operationId: getByronWalletMigrationInfo
tags: ["Byron Migrations"]
Expand Down

0 comments on commit 20a6ab4

Please sign in to comment.