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

Migrate from tzstats to tzpro #685

Merged
merged 11 commits into from
Nov 4, 2023
Merged

Migrate from tzstats to tzpro #685

merged 11 commits into from
Nov 4, 2023

Conversation

jdsika
Copy link
Contributor

@jdsika jdsika commented Nov 1, 2023

  • Check list:
  • I extended the Github Actions CI test units with the corresponding tests for this new feature (if needed).
  • I extended the Sphinx documentation (if needed).
  • I extended the help section (if needed).
  • I changed the README file (if needed).
  • I created a new issue if there is further work left to be done (if needed).

Work effort: 6h

Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
@jdsika jdsika added enhancement New feature or request critical Critical labels Nov 1, 2023
@jdsika jdsika added this to the v11.5 (Lima) milestone Nov 1, 2023
…lder

Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
@jdsika jdsika requested a review from vkresch November 1, 2023 21:06
Signed-off-by: Carlo van Driesten <carlo.van-driesten@bmw.de>
Signed-off-by: Carlo van Driesten <carlo.van-driesten@bmw.de>
@jdsika jdsika marked this pull request as ready for review November 2, 2023 14:36
@Nikolay-everstake
Copy link

Yep it works for us. Thank you.

@vkresch
Copy link
Contributor

vkresch commented Nov 3, 2023

Any reasons for this migration?
Can't we just extend the API with tzpro instead of replacing tzstats with it or is tzstat going to be deprecated?
Please provide some context in the description. Thanks!

Update tzstats going to be deprecated:

TzStats API EOL @ Oct 31, 2023
Attention TzStats API users

We are migrating all RPC and API services to our new TzPro service. Visit https://tzpro.io/ and sign up for free to get your personal API key.

All API data and endpoints will remain available and free on TzPro up to 100,000 req/mon.

https://tzstats.com/

@jdsika
Copy link
Contributor Author

jdsika commented Nov 3, 2023

It was deprecated and replaced. Here is the migration guide. Tzstats does not exist anymore:

https://blockwatch.cc/blog/migrating-to-tzpro/

@vkresch
Copy link
Contributor

vkresch commented Nov 3, 2023

Ok got it. Thanks for the context.

@jdsika
Copy link
Contributor Author

jdsika commented Nov 3, 2023

I tired to catch absolutely every occurance of tzstats and also renamed the folder to blockwatch (the company behind it) in order to pave the way to include new API Interfaces later (if needed)

try:
key = os.getenv("TZPRO_API_KEY")
except:
verbose_logger.exception("Unable to load TZPRO_API_KEY from .env file!")
Copy link
Contributor

Choose a reason for hiding this comment

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

How about we add the api key to the command line when using tzpro instead of forcing the user to create a .env file? We are currently not using envríronmental variables anywhere in the project.

Copy link
Contributor

Choose a reason for hiding this comment

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

We might wanna setup then a test api key for our test pipeline. For that we might use the secrets manager of github actions.

Copy link
Contributor

Choose a reason for hiding this comment

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

We have a config file, we put api for twitter and other in it, why not use it. Why spread the config.

Copy link
Contributor

Choose a reason for hiding this comment

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

Even better :)

@vkresch
Copy link
Contributor

vkresch commented Nov 3, 2023

@jdsika can I push commits on this PR?

@jdsika
Copy link
Contributor Author

jdsika commented Nov 4, 2023

@jdsika can I push commits on this PR?

yes, please! I am on erics side to put it in the config. I did not think about (stupid)

@vkresch
Copy link
Contributor

vkresch commented Nov 4, 2023

Not ready yet. I am fixing the tests now. DO NOT MERGE!

Copy link
Contributor

@vkresch vkresch left a comment

Choose a reason for hiding this comment

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

There are still some failing tests due to API updates which needs further investigation and is out of scope for this PR. I also noticed that the enum comparisons are not working correctly and I am not sure why. E.g. payment_item.paid == PaymentStatus.PAID is false but payment_item.paid.is_paid() is true. That's really confusing. Best way to compare enums would be to compare their values for now:
payment_item.paid.value == PaymentStatus.PAID.value

Currently failing tests:

  • test_attempt_single_batch_tz
  • test_attempt_single_batch_KT
  • test_batch_payer_total_payout_amount
  • test_simulate_single_operation
  • test_failed_simulate_single_operation
  • test_reset
  • test_archive

Effort: 8h

@jdsika jdsika merged commit c852b20 into master Nov 4, 2023
3 of 8 checks passed
@jdsika jdsika deleted the fix/tzpro branch November 4, 2023 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
critical Critical enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants