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

Add API endpoint to restore a legacy wallet. #774

Closed
6 tasks done
jonathanknowles opened this issue Oct 1, 2019 · 1 comment
Closed
6 tasks done

Add API endpoint to restore a legacy wallet. #774

jonathanknowles opened this issue Oct 1, 2019 · 1 comment
Assignees

Comments

@jonathanknowles
Copy link
Member

jonathanknowles commented Oct 1, 2019

Context

This task will provide an API endpoint that allows users to restore a Byron wallet from a mnemonic sentence.

Decision

The API will provide an endpoint similar to the following:

/byron/wallets:
  post:
    operationId: postByronWallet
    tags: ["Wallets"]
    summary: Restore
    description: Restore a Byron wallet from a mnemonic sentence.
    parameters:
      - <<: *parametersBody
        schema: *ApiByronWalletPostData
    responses: *responsesPostByronWallet

Where types have definitions similar to the following:

ApiByronWalletPostData: &ApiByronWalletPostData
  type: object
  required:
    - name
    - mnemonic_sentence
    - passphrase
  properties:
    name: *walletName
    mnemonic_sentence: *byronWalletMnemonicSentence
    passphrase: *walletPassphrase
x-byronWalletMnemonicSentence: &byronWalletMnemonicSentence
  description: A list of mnemonic words
  type: array
  minItems: 12
  maxItems: 12
  items:
    type: string
    format: bip-0039-mnemonic-word{english}
  example:
    [ "squirrel", "material", "silly", "twice", "direct", "slush"
    , "pistol", "razor", "become", "junk", "kingdom", "flee"]
x-responsesPostByronWallet: &responsesPostByronWallet
  <<: *responsesErr400
  <<: *responsesErr405
  <<: *responsesErr406
  <<: *responsesErr409
  <<: *responsesErr415
  202:
    description: Accepted
    schema: *ApiByronWallet

Acceptance Criteria

Within the list of criteria below, a ticked criterion indicates that there is test coverage in the master branch to demonstrate that this criterion is satisfied.

  • The API must support restoration of Byron wallets through a dedicated endpoint.
  • After a successful restoration, calling getByronWallet with a restored wallet ID must succeed.
  • After a successful restoration, the listByronWallets operation must include the restored wallet in the list it returns.
  • After a successful restoration, calling getByronWallet with a restored wallet ID must succeed.
  • After a successful restoration, calling postByronWallet again with the same mnemonic sentence should result in an error.

PR

Number Base
#790 master
#817 master
#846 master

QA

  • Build integration tests to check that all acceptance criteria are satisfied.
@jonathanknowles jonathanknowles added this to the Legacy Wallet Support milestone Oct 1, 2019
@jonathanknowles jonathanknowles self-assigned this Oct 3, 2019
iohk-bors bot added a commit that referenced this issue Oct 3, 2019
790: Provide skeletal API endpoints for functions on Byron-style wallets.   r=piotr-iohk a=jonathanknowles

# Issue Number

#774 
#775 
#776 
#777 

# Overview

This PR provides skeletal API endpoints for a subset of the functions on Byron-style wallets.

The goal of this PR is to establish the general direction, including types and module organization, and not to provide a complete implementation. (This will be provided in further PRs.)

- [x] Separated the API into a core API (non-legacy) and a compatibility API (includes operations on Byron wallets).
- [x] Provided API types for a subset of functions on Byron-style wallets.
- [x] Provided compatibility API server implementation that returns HTTP 501 (Not Implemented) for each of the functions on Byron-style wallets.
- [x] Added appropriate definitions to the Swagger API specification.

Co-authored-by: Jonathan Knowles <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 15, 2019
817: Implement basic API functions for Byron-style wallets.  r=jonathanknowles a=jonathanknowles

# Issue Number

#774 (`restoreByronWallet`)
#775 (`listByronWallets`)
#776 (`getByronWallet`)
#777 (`deleteByronWallet`)

# Overview

This PR implements all API functions _**apart from**_ those relating to _**migration**_.

We have:

- [x] Provided an implementation for [`restoreByronWallet`](#774).
- [x] Provided an implementation for [`listByronWallets`](#775).
- [x] Provided an implementation for [`getByronWallets`](#776).
- [x] Provided an implementation for [`deleteByronWallet`](#777).
- [x] Fixed **existing** integration tests for all of the above.

# Not included in this PR

Further integration tests: these will be included in _**further**_ sub-topic PRs.

Co-authored-by: Jonathan Knowles <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 16, 2019
841: Group tags by era (Shelley vs Byron) in swagger documentation r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#774 #775 #776 #777 #778 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have renamed `/external-transactions` to `/proxy/transactions` to better convey its meaning
- [x] I have renamed all `/byron/wallets` to `/byron-wallets` as per the discussion we had on slack
- [x] I have renamed `/.../migrate` to `/.../migrations`, REST is about resources, not actions. 
- [x] I have grouped and organize API tags by eras such that it's more readable:

![Screenshot from 2019-10-16 13-38-08](https://user-images.githubusercontent.com/5680256/66916252-24946900-f01b-11e9-9060-9a6aa88d0ac4.png)


# Comments

<!-- Additional comments or screenshots to attach if any -->

:warning: base branch is `jonathanknowles/migrate-byron-wallet-return-type`

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: KtorZ <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 16, 2019
841: Group tags by era (Shelley vs Byron) in swagger documentation r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#774 #775 #776 #777 #778 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have renamed `/external-transactions` to `/proxy/transactions` to better convey its meaning
- [x] I have renamed all `/byron/wallets` to `/byron-wallets` as per the discussion we had on slack
- [x] I have renamed `/.../migrate` to `/.../migrations`, REST is about resources, not actions. 
- [x] I have grouped and organize API tags by eras such that it's more readable:

![Screenshot from 2019-10-16 13-38-08](https://user-images.githubusercontent.com/5680256/66916252-24946900-f01b-11e9-9060-9a6aa88d0ac4.png)


# Comments

<!-- Additional comments or screenshots to attach if any -->

:warning: base branch is `jonathanknowles/migrate-byron-wallet-return-type`

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: KtorZ <[email protected]>
@piotr-iohk
Copy link
Contributor

lgtm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants