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

WalletNotFound error in listEosWallets handler #354

Closed
denisshevchenko opened this issue Feb 21, 2019 · 2 comments
Closed

WalletNotFound error in listEosWallets handler #354

denisshevchenko opened this issue Feb 21, 2019 · 2 comments
Assignees
Labels
BUG Something isn't working RESTROSPECTIVE ADR needs restrospective session

Comments

@denisshevchenko
Copy link
Contributor

denisshevchenko commented Feb 21, 2019

Release Operating System Cause
next Windows & OSX & Linux) Code v Configuration v Environment v Human v Unknown

Context

GET-request to /api/v1/wallets/externally-owned endpoint should return the list of available EOS-wallets. However currently it always returns WalletNotFound error.

Steps to Reproduce

  1. Just send GET-request to /api/v1/wallets/externally-owned endpoint with any parameters.

Expected behavior

Endpoint returns a list of available EOS-wallets.

Actual behavior

Endpoint always returns WalletNotFound error.


Resolution Plan

So, look at listEosWallets definition:

:<|> "wallets"
        :> "externally-owned"
        :> Summary "Returns a list of the available wallets."
        ...
        :> Get '[ValidJSON] (APIResponse [EosWallet])

This tells us that if the path is /api/v1/wallets/externally-owned and the HTTP verb GET, the server should route the request to the listEosWallets handler. However, before that, we have another endpoint defined as:

:<|> "wallets" :> CaptureWalletId
               :> Summary "Returns the Wallet identified by the given walletId."
               :> Get '[ValidJSON] (APIResponse Wallet)

Which tells us that, if a request is made to /api/v1/wallets/{walletId} and the HTTP verb is GET, then we should the request through the getWallet handler, capturing whatever {walletId} is provided in the path.

So, externally-owned in the path is interpreted as-if it was the {walletId} from the getWallet endpoint. But this isn't a valid wallet id, hence the WalletNotFound error.

PR

Number Base
#355 develop

QA

@denisshevchenko denisshevchenko self-assigned this Feb 21, 2019
@KtorZ KtorZ added the BUG Something isn't working label Feb 21, 2019
@KtorZ KtorZ added this to the Address Derivation à la BIP-44 milestone Feb 21, 2019
@KtorZ
Copy link
Contributor

KtorZ commented Feb 21, 2019

Note: the doc has been successfully updated on develop 😉

https://input-output-hk.github.io/cardano-wallet/#tag/Externally-Owned-Wallets

@piotr-iohk
Copy link
Contributor

lgtm 👍
I'll be adding more integration tests for listEosWallets in #331.

@piotr-iohk piotr-iohk added the RESTROSPECTIVE ADR needs restrospective session label Feb 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
BUG Something isn't working RESTROSPECTIVE ADR needs restrospective session
Projects
None yet
Development

No branches or pull requests

3 participants