-
Notifications
You must be signed in to change notification settings - Fork 217
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
Add test checking fail to fetch asset metadata #2674
Merged
+93
−2
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
|
||
# Error reported in API when failing to fetch metadata | ||
|
||
## OS | ||
|
||
Any | ||
|
||
## Steps | ||
|
||
1. Start cardano-node and cardano-wallet on `testnet` using latest [config](https://hydra.iohk.io/job/Cardano/iohk-nix/cardano-deployment/latest/download/1/index.html). Make sure both are fully synced. | ||
|
||
```bash | ||
$ cardano-node run \ | ||
--config ./*-config.json \ | ||
--topology ./*-topology.json \ | ||
--database-path ./db \ | ||
--socket-path ./node.socket | ||
|
||
$ cardano-wallet serve --port 8090 \ | ||
--node-socket ../relay1/node.socket \ | ||
--testnet testnet-byron-genesis.json \ | ||
--database ./wallet-db \ | ||
--token-metadata-server http://localhost/ | ||
``` | ||
Make sure wallet server `--token-metadata-server` points to an url which is not token metadata server. | ||
|
||
2. Restore one of the wallets which has some assets. | ||
|
||
The following command will decrypt the E2E test fixtures (see LastPass for the password). | ||
|
||
```console | ||
$ export TESTS_E2E_FIXTURES=******* | ||
$ nix-shell --run "cd test/e2e && rake fixture_wallets_decode" | ||
$ jq 'map_values(.shelley|join(" "))' test/e2e/fixtures/fixture_wallets.json | ||
``` | ||
|
||
This will restore the Shelley E2E test wallet for Linux: | ||
|
||
```console | ||
$ jq '{ name: "E2E Linux Shelley", passphrase: "Secure passphrase", mnemonic_sentence: .linux.shelley }' test/e2e/fixtures/fixture_wallets.json | curl -H 'Content-type: application/json' http://localhost:8091/v2/wallets --data @- | jq . | ||
{ | ||
"id": "b1fb863243a9ae451bc4e2e662f60ff217b126e2", | ||
"assets": { | ||
"total": [ ... ], | ||
"available": [ ... ] | ||
}, | ||
... | ||
} | ||
``` | ||
|
||
3. On the wallet that has some assets check that `"metadata_error":"fetch"` is returned when getting assets. | ||
- when listing all assets | ||
``` | ||
$ curl -X GET http://localhost:8090/v2/wallets/73d38c71e4b8b5d71769622ab4f5bfdedbb7c39d/assets | ||
|
||
[ | ||
... | ||
{ | ||
"asset_name": "496e737472756d656e74616c4f4b3133", | ||
"fingerprint": "asset123svc349ccm6njzpu6w3uzu6cnw87t9l95dmcy", | ||
"metadata_error": "fetch", | ||
"policy_id": "c7b3f8f9d6a02027e7b5ce2a4da0ff3f68d6d49d4ca58c96c5900b37" | ||
}, | ||
... | ||
] | ||
``` | ||
- when getting asset with only policy id | ||
``` | ||
$ curl -X GET http://localhost:8090/v2/wallets/73d38c71e4b8b5d71769622ab4f5bfdedbb7c39d/assets/789ef8ae89617f34c07f7f6a12e4d65146f958c0bc15a97b4ff169f1 | ||
|
||
{ | ||
"asset_name": "", | ||
"fingerprint": "asset1656gm7zkherdvxkn52mhaxkkw343qtkqgv0h8c", | ||
"metadata_error": "fetch", | ||
"policy_id": "789ef8ae89617f34c07f7f6a12e4d65146f958c0bc15a97b4ff169f1" | ||
} | ||
``` | ||
- when getting asset with policy id and asset name | ||
``` | ||
$ $ curl -X GET http://localhost:8090/v2/wallets/73d38c71e4b8b5d71769622ab4f5bfdedbb7c39d/assets/005bd7d46219700eccb77cbf7122055a0b26cd064db51e1277cc1b0b/653265636f696e3635 | ||
|
||
{ | ||
"asset_name": "653265636f696e3635", | ||
"fingerprint": "asset1txvs0057gd63g02q4ttrd86vgxlv3scjua7r03", | ||
"metadata_error": "fetch", | ||
"policy_id": "005bd7d46219700eccb77cbf7122055a0b26cd064db51e1277cc1b0b" | ||
} | ||
|
||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we mention the public key for this wallet such that anyone can run this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a nice idea.
In the meantime I have added instructions for how to get one of our E2E fixture wallets, using the password from our shared LastPass folder.