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

GET v2/wallets does not list wallets from oldest to newest #250

Closed
4 of 5 tasks
piotr-iohk opened this issue May 9, 2019 · 4 comments
Closed
4 of 5 tasks

GET v2/wallets does not list wallets from oldest to newest #250

piotr-iohk opened this issue May 9, 2019 · 4 comments
Assignees

Comments

@piotr-iohk
Copy link
Contributor

piotr-iohk commented May 9, 2019

Release Operating System Cause
next Linux Code or Human or Unknown

Context

https://input-output-hk.github.io/cardano-wallet/api/#operation/listWallets says Return a list of known wallets, ordered from oldest to newest. which currently it not the case.

Steps to Reproduce

  1. Add wallets "1", "2" and "3" in the following order:
curl  -vX POST http://localhost:8090/v2/wallets \
  -H "Content-Type: application/json; charset=utf-8" \
  -d '{
"name": "1",
"mnemonic_sentence": ["network", "empty", "cause", "mean", "expire", "private",
        "finger", "accident", "session", "problem", "absurd", "banner", "stage",
        "void", "what"],
"passphrase": "Secure Passphrase",
"address_pool_gap": 20
}' --http1.1  |  jq


curl  -vX POST http://localhost:8090/v2/wallets \
  -H "Content-Type: application/json; charset=utf-8" \
  -d '{
"name": "2",
"mnemonic_sentence": ["whisper", "control", "diary", "solid", "cattle", "salmon",
        "whale", "slender", "spread", "ice", "shock", "solve", "panel",
        "caution", "upon", "scatter", "broken", "tonight"],
"passphrase": "Secure Passphrase",
"address_pool_gap": 20
}' --http1.1  |  jq


curl  -vX POST http://localhost:8090/v2/wallets \
  -H "Content-Type: application/json; charset=utf-8" \
  -d '{
"name": "3",
"mnemonic_sentence": ["click", "puzzle", "athlete", "morning", "fold", "retreat",
        "across", "timber", "essay", "drill", "finger", "erase", "galaxy",
        "spoon", "swift", "eye", "awesome", "shrimp", "depend", "zebra", "token"],
"passphrase": "Secure Passphrase",
"address_pool_gap": 20
}' --http1.1  |  jq
  1. List added wallets:

curl -vX GET http://localhost:8090/v2/wallets | jq

Expected behavior

Should be listed (by wallet name):
1
2
3

Actual behavior

Wallets are listed in the following order (by wallet name):
3
1
2


Resolution Plan

Required:

  • Add creationTime field to Cardano.Wallet.Primitive.Types.WalletMetadata
  • Incrementally recompile the code, correcting errors until the code compiles successfully.
  • Add appropriate API tests to demonstrate that wallets are listed in the correct order.
  • Make the tests pass by performing sorting in the appropriate place.

Optional:

  • Add creationTime field to Cardano.Wallet.Api.Types.ApiWallet

PR

Number Base
#344 develop

QA

@piotr-iohk piotr-iohk added the BUG label May 9, 2019
@jonathanknowles
Copy link
Member

@KtorZ Do you know if there's an operation or interface that makes it possible to determine the "creation time" of a wallet? (I had a brief look through the code, but couldn't spot anything relevant.) If not, how we would go about determining this info? (And where should it be stored?)

@KtorZ
Copy link
Member

KtorZ commented May 21, 2019

We cannot do this at the moment indeed. So we should have some sort of timestamp somewhere. What makes most sense is probably to have that within the wallet metadata and store it upon creation.

@jonathanknowles
Copy link
Member

Fix available: #344

@piotr-iohk
Copy link
Contributor Author

fixed 👍

@KtorZ KtorZ added this to the Bugs Sprint 21-22 milestone May 31, 2019
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

No branches or pull requests

3 participants