Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2177: Create API address derivation path type. r=jonathanknowles a=jonathanknowles # Issue Number #2174 # Overview This PR adds a new type `ApiAddressDerivationPath`. A value of this type serializes to a JSON **list**. For example, the path `1852H/1815H/0H/0/0` has the following JSON representation: ```json [ { "derivation_index": 1852, "derivation_type": "hardened" }, { "derivation_index": 1815, "derivation_type": "hardened" }, { "derivation_index": 0, "derivation_type": "hardened" }, { "derivation_index": 0, "derivation_type": "soft" }, { "derivation_index": 0, "derivation_type": "soft" } ] ``` Each entry in the list has the following pair of fields: | Field name | Type | Domain | | -- | -- | -- | | `derivation_index` | natural number | `[ 0 .. 2^31 − 1 ]` | | `derivation_type` | enumeration | `[ hardened \| soft ]` | # Details This PR also: - Adds JSON roundtrip tests for `ApiAddressDerivationPath`. - Adds a missing JSON roundtrip test for the `ApiAddress` type. - Fixes the upper bound of `addressIndex` to be `2^32 - 1` rather than `2^32`. - Adds a matching swagger definition for `ApiAddressDerivationPath`. Co-authored-by: Jonathan Knowles <jonathan.knowles@iohk.io>
- Loading branch information
Showing
8 changed files
with
973 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.