Skip to content

Conversation

@apskhem
Copy link
Contributor

@apskhem apskhem commented Apr 9, 2025

  • Added test data extracted from preprod.cexplorer.io using snapshot-80000000-preprod.json as a reference.

Closes #2143

@apskhem apskhem requested a review from Mr-Leshiy April 9, 2025 18:11
@apskhem apskhem self-assigned this Apr 9, 2025
@apskhem apskhem force-pushed the feat/prepare-cardano-assets branch from 9f901f2 to 8fc4d13 Compare April 9, 2025 18:23
@apskhem apskhem marked this pull request as draft April 9, 2025 20:47
@apskhem apskhem marked this pull request as ready for review April 10, 2025 05:28
Copy link
Contributor

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

Copy link
Contributor

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)

@@ -0,0 +1,160 @@
"""
This script is a simple web scraper tool to prepare testing data for the `cardano/asset` endpoint.
Copy link
Contributor

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

formatted_records = {}
processing_records = snapshot_data[:]
for (i, record) in enumerate(processing_records):
stake_addr = address.stake_public_key_to_address(
Copy link
Contributor

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

-H 'user-agent: {USER_AGENT}'"

args = shlex.split(curl_command)
result = subprocess.run(args, capture_output=True, text=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

why using curl instead of using python requests library ?
I think it would be better and simpler to use requests lib

Copy link
Contributor Author

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.

Copy link
Contributor

@Mr-Leshiy Mr-Leshiy left a comment

Choose a reason for hiding this comment

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

LGTM

@Mr-Leshiy Mr-Leshiy merged commit 25c28e5 into main Apr 15, 2025
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.

Prepare test data for cardano/assets endpoint

3 participants