Skip to content
This repository has been archived by the owner on Mar 1, 2019. It is now read-only.

Make error messages for index and addressPoolGap consistent #342

Open
piotr-iohk opened this issue Feb 15, 2019 · 0 comments
Open

Make error messages for index and addressPoolGap consistent #342

piotr-iohk opened this issue Feb 15, 2019 · 0 comments
Labels
PROPOSED ADR just proposed

Comments

@piotr-iohk
Copy link
Contributor

piotr-iohk commented Feb 15, 2019

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:

  • Client.postEosWallet
  • Client.updateEosWallet

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

  • values 0, 1, 2147483647- Account index should be in range [2147483648..4294967295]
  • values -1, 4294967296 - Word32 is either floating or will cause over or underflow

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

  • values 1, 0, 9, 101 - Address pool gap should be in range [10..100]
  • value -1 - Word8 is either floating or will cause over or underflow: -1.0

As explained in cardano-foundation/cardano-wallet#334 (comment) 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.:

  • Account index should be in range [2147483648..4294967295] - for index
  • Address pool gap should be in range [10..100] - for addressPoolGap

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PROPOSED ADR just proposed
Projects
None yet
Development

No branches or pull requests

1 participant