-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add cardano/assets response test data
#4
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
Conversation
9f901f2 to
8fc4d13
Compare
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.
Dont add this file into this repo, move it into the https://github.com/input-output-hk/catalyst-storage repo
scripts/prepare_cardano_asset.py
Outdated
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.
I think its better to move this script to the catalyst-voices/catalyst-gateway/tests/api_tests/scripts folder (we dont have such folder now, just create it)
scripts/prepare_cardano_asset.py
Outdated
| @@ -0,0 +1,160 @@ | |||
| """ | |||
| This script is a simple web scraper tool to prepare testing data for the `cardano/asset` endpoint. | |||
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.
Add some notes how to run this script, what is needed to prepare (if something needed).
something like
SOME_ENV_VARS python3 prepare_cardano_asset.py
scripts/prepare_cardano_asset.py
Outdated
| formatted_records = {} | ||
| processing_records = snapshot_data[:] | ||
| for (i, record) in enumerate(processing_records): | ||
| stake_addr = address.stake_public_key_to_address( |
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.
after moving this file under the api_tests project use utils/address.py mod
scripts/prepare_cardano_asset.py
Outdated
| -H 'user-agent: {USER_AGENT}'" | ||
|
|
||
| args = shlex.split(curl_command) | ||
| result = subprocess.run(args, capture_output=True, text=True) |
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.
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.
I tried using request with the same settings but it failed to request the pages. It should be something to do with session/cookies which curl can do only. So that's why using curl instead.
Mr-Leshiy
left a comment
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.
LGTM
preprod.cexplorer.iousingsnapshot-80000000-preprod.jsonas a reference.Closes #2143