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

Wallet update passphrase integration tests #261

Merged
merged 3 commits into from
May 15, 2019

Conversation

piotr-iohk
Copy link
Contributor

Issue Number

Overview

  • I have fixed success response for PUT v2/wallets/{wallet-id}/passphrase to be inline with API spec (204)
  • added integration tests
  • removed 410 code from the API spec for PUT v2/wallets/{wallet-id} and PUT v2/wallets/{wallet-id}/passphrase as it seems it currently cannot be produced

Comments

@piotr-iohk piotr-iohk self-assigned this May 14, 2019
if (title == "40 chars hex") then
expectResponseCode @IO HTTP.status403 rup
else
expectResponseCode @IO HTTP.status404 rup
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a slight inconsistency in the behavior: There is 403 being returned in case when {wallet-id} is a 40 char long hex encoded string (ofc, for the wallet that does not exist). For any other string it returns 404 (e.g. longer/shorter than 40 chars, 40 char length but not valid hex).

I think I'd be expecting either 404 for all. Or 400 for not valid IDs and 404 for valid and not existing (but this cannot be achieved now #252 (comment))

Not sure if this is something that can be addressed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm... Probably has to do with the way we map the error when a root private key can't be found. I'll have a look at it.

@piotr-iohk piotr-iohk requested a review from KtorZ May 14, 2019 12:00
} |]
r <- request @ApiWallet ctx ("POST", "v2/wallets") Default createPayload
let payload = updatePassPayload oldPass
(T.pack (replicate passphraseMaxLength '💘'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it.

@KtorZ KtorZ merged commit 61b5a7d into master May 15, 2019
@KtorZ KtorZ deleted the piotr/integration_tests_update_pass branch May 15, 2019 10:50
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

Successfully merging this pull request may close these issues.

2 participants