Сryptocurrency development analysis

Description

The example accountId from the API doc isn’t much relevant and reflects an invalid value

## Linked issue

https://iohk.myjetbrains.com/youtrack/issue/CO-319

## Type of change

– [x] 🐞 Bug fix (non-breaking change which fixes an issue)
– [ ] 🛠 New feature (non-breaking change which adds functionality)
– [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
– [x] 🏭 Refactoring that does not change existing functionality but does improve things like code readability, structure etc
– [x] 🔨 New or improved tests for existing code
– [ ] ⛑ git-flow chore (backport, hotfix, etc)

## Developer checklist

– [x] I have read the [style guide](https://github.com/input-output-hk/cardano-sl/blob/develop/docs/style-guide.md) document, and my code follows the code style of this project.
– [ ] If my code deals with exceptions, it follows the [guidelines](https://github.com/input-output-hk/cardano-sl/blob/develop/docs/exceptions.md).
– [x] I have updated any documentation accordingly, if needed. Documentation changes can be reflected in opening a PR on [cardanodocs.com](https://github.com/input-output-hk/cardanodocs.com), amending the inline [Haddock](https://www.haskell.org/haddock/) comments, any relevant README file or one of the document listed in the [docs](https://github.com/input-output-hk/cardano-sl/tree/develop/docs) directory.

## Testing checklist

– [x] I have added tests to cover my changes.
– [x] All new and existing tests passed.

## QA Steps
1) Run a cardano-node
2) Visit https://localhost:8091/docs/v1/index/ – you will see changes showed bellow
3) Roundtrip tests pass (the screenshot bellow)

## Screenshots (if available)
`accountIndex` in request body shows correct value range
`accountIndex` on description on the right picks correct value (not bellow the minimum)
![look](https://user-images.githubusercontent.com/2461951/41376284-1caf5fe0-6f59-11e8-87db-0d5a1bcd461c.png)

`accountId` (same thing as `accountIndex`) in request params shows correct value range
![look](https://user-images.githubusercontent.com/2461951/41376464-96e8cd6e-6f59-11e8-8a3e-f967d41ac076.png)

roundtrip tests
![look](https://user-images.githubusercontent.com/2461951/41376705-4a2977d4-6f5a-11e8-936d-309a09b92358.png)

@KtorZ I wonder why did we ended up with `accountId` and `accountIndex` json keys for the same thing. Is it still too late to unify it? (it would be a breaking change for exchanges)

You can view, comment on, or merge this pull request online at:

https://github.com/input-output-hk/cardano-sl/pull/3086

— Commit Summary —

* [CO-319] Fix account index swagger example
* [CO-319] Add roundtrip tests

— File Changes —

M wallet-new/src/Cardano/Wallet/API/V1/Migration/Types.hs (8)
M wallet-new/src/Cardano/Wallet/API/V1/Swagger.hs (4)
M wallet-new/src/Cardano/Wallet/API/V1/Types.hs (52)
M wallet-new/test/MarshallingSpec.hs (29)

— Patch Links —

https://github.com/input-output-hk/cardano-sl/pull/3086.patch
https://github.com/input-output-hk/cardano-sl/pull/3086.diff

This post was last modified on June 13, 2018, 10:43 pm

Categories: cryptocurrency