input-output-hk / cardano-wallet-legacy

Official Wallet Backend & API for Cardano-SL
https://input-output-hk.github.io/cardano-wallet/
MIT License
21 stars 12 forks source link

Make error messages for index and addressPoolGap consistent #342

Open piotr-iohk opened 5 years ago

piotr-iohk commented 5 years ago

Context

When testing EOS Wallets under #334 I noticed that there are some inconsistent error messages returned for parameters index and addressPoolGap for certain values outside their ranges. This is observed for endpoints:

For index (range [2147483648..4294967295]):

For addressPoolGap (range [10..100]):

As explained in https://github.com/input-output-hk/cardano-wallet/pull/334#discussion_r257114227 this is currently expected, however, I believe the messages should be consistent here and informative therefore we should make the API return the message ... should be in range... for every value outside of the range.

Decision

Make API return consistent and informative error message when index and addressPoolGap is off the range, i.e.:

Acceptance Criterias

The API must return consistent error messages for index and addressPoolGap as described above. The change would affect following integration tests that will need to have their expectations updated:

EOSWALLETS_CREATE_02 - addressPoolGap cannot be outside [10..100]
EOSWALLETS_CREATE_03 - index must be [2147483648..4294967295]
EOSWALLETS_UPDATE_03 - addressPoolGap cannot be outside [10..100]

Development Plan

PR

Number Base
#? develop

QA

Criteria Coverage
? -

Retrospective