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

fix/solve_token_list_parsing_issue #338

Merged
merged 1 commit into from
Jul 30, 2024
Merged

Conversation

aarmoa
Copy link
Collaborator

@aarmoa aarmoa commented Jul 30, 2024

  • Fixed an issue in the code that loads tokens from the official tokens list.
  • Regenerated the denoms INI files

Summary by CodeRabbit

  • New Features

    • Updated token identification logic to enhance the handling of token denominations.
    • Introduced factory-based naming conventions for various tokens in configuration files.
    • Added new token entries with updated precision values.
  • Bug Fixes

    • Adjusted token decimal values for greater accuracy in financial calculations.
  • Documentation

    • Improved clarity and organization of configuration files for better readability and maintainability.

…tokens list. Regenerated the denoms INI files
Copy link
Contributor

coderabbitai bot commented Jul 30, 2024

Walkthrough

The changes enhance the token management system by modifying the assignment logic in an asynchronous function and restructuring denomination identifiers in configuration files. Key updates include shifting from symbol-based to denomination-based identification for tokens under certain conditions, and transitioning to a factory-based naming convention for denominators, which may improve clarity and interoperability within the ecosystem.

Changes

Files Change Summary
pyinjective/async_client.py Modified _tokens_from_official_lists logic to assign unique_symbol from denom when conditions are met.
pyinjective/denoms_devnet.ini Updated peggy_denom values to factory paths; adjusted decimals across various denominations; added new entries.
pyinjective/denoms_testnet.ini Similar updates to peggy_denom with factory paths and decimals; new entries added for clarity and organization.

Poem

🐰 In the garden where tokens grow,
A shift in names, a lovely flow.
From symbols bright to denoms clear,
We hop with joy, spread cheer and cheer!
Factory paths lead the way,
In this wondrous token ballet! 🎉


Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 572d3ad and 6bc6d27.

Files selected for processing (3)
  • pyinjective/async_client.py (1 hunks)
  • pyinjective/denoms_devnet.ini (20 hunks)
  • pyinjective/denoms_testnet.ini (34 hunks)
Additional comments not posted (37)
pyinjective/denoms_devnet.ini (13)

351-352: Verify the updated peggy_denom value for [ASTRO].

Ensure that the new identifier ibc/E8AC6B792CDE60AB208CA060CA010A3881F682A7307F624347AB71B6A0B0BF89 is correct and consistent with the naming convention.


355-356: Verify the updated peggy_denom and decimals value for [ATOM].

Ensure that the new identifier factory/inj17vytdwqczqz72j65saukplrktd4gyfme5agf6c/atom and the updated decimals value 8 are correct and consistent with the naming convention.


411-412: Verify the updated peggy_denom and decimals value for [BINJ].

Ensure that the new identifier factory/inj10q36ygr0pkz7ezajcnjd2f0tat5n737yg6g6d5/binj and the updated decimals value 18 are correct and consistent with the naming convention.


527-528: Verify the updated peggy_denom value for [COKE].

Ensure that the new identifier factory/inj158g7dfclyg9rr6u4ddxg9d2afwevq5d79g2tm6/coke is correct and consistent with the naming convention.


583-584: Verify the updated peggy_denom and decimals value for [DOT].

Ensure that the new identifier ibc/624BA9DD171915A2B9EA70F69638B2CEA179959850C1A586F6C485498F29EDD4 and the updated decimals value 10 are correct and consistent with the naming convention.


603-604: Verify the updated peggy_denom value for [ELON].

Ensure that the new identifier inj10pqutl0av9ltrw9jq8d3wjwjayvz76jhfcfza0 is correct and consistent with the naming convention.


731-732: Verify the updated peggy_denom value for [INJ].

Ensure that the new identifier inj is correct and consistent with the naming convention.


843-844: Verify the updated peggy_denom value for [LIOR].

Ensure that the new identifier factory/inj1cjus5ragdkvpmt627fw7wkj2ydsra9s0vap4zx/lior is correct and consistent with the naming convention.


1055-1056: Verify the updated peggy_denom value for [PYUSD].

Ensure that the new identifier ibc/4367FD29E33CDF0487219CD3E88D8C432BD4C2776C0C1034FF05A3E6451B8B11 is correct and consistent with the naming convention.


1079-1080: Verify the updated peggy_denom and decimals value for [QAT].

Ensure that the new identifier inj1m4g54lg2mhhm7a4h3ms5xlyecafhe4macgsuen and the updated decimals value 8 are correct and consistent with the naming convention.


1582-1584: Verify the new section [factory/inj1jfuyujpvvkxq4566r3z3tv3jdy29pqra5ln0yk/kira].

Ensure that the new section and its values are correct and consistent with the naming convention.


1838-1840: Verify the new section [unknown].

Ensure that the new section and its values are correct and consistent with the naming convention.


1843-1844: Verify the updated peggy_denom value for [wBTC].

Ensure that the new identifier factory/inj14ejqjyq8um4p3xfqj74yld5waqljf88f9eneuk/inj14au322k9munkmx5wrchz9q30juf5wjgz2cfqku is correct and consistent with the naming convention.

pyinjective/async_client.py (1)

3440-3440: Ensure the new assignment logic for unique_symbol is correct.

The assignment of unique_symbol is changed from token.symbol to token.denom under specific conditions. Verify that this change aligns with the intended functionality and does not introduce any side effects.

pyinjective/denoms_testnet.ini (23)

541-542: LGTM!

The changes to the peggy_denom and decimals values for the [AK] section are consistent with the shift towards a factory-based naming convention.


621-622: LGTM!

The changes to the peggy_denom and decimals values for the [ATOM] section are consistent with the shift towards a factory-based naming convention.


709-710: LGTM!

The changes to the peggy_denom and decimals values for the [BINJ] section are consistent with the shift towards a factory-based naming convention.


901-902: LGTM!

The changes to the peggy_denom and decimals values for the [COKE] section are consistent with the shift towards a factory-based naming convention.


1069-1070: LGTM!

The changes to the peggy_denom and decimals values for the [DOT] section are consistent with the shift towards a factory-based naming convention.


1109-1110: LGTM!

The changes to the peggy_denom and decimals values for the [ELON] section are consistent with the shift towards a factory-based naming convention.


1401-1402: LGTM!

The changes to the peggy_denom and decimals values for the [INJ] section are consistent with the shift towards a factory-based naming convention.


1645-1646: LGTM!

The changes to the peggy_denom and decimals values for the [KIRA] section are consistent with the shift towards a factory-based naming convention.


1729-1730: LGTM!

The changes to the peggy_denom and decimals values for the [LIOR] section are consistent with the shift towards a factory-based naming convention.


1833-1834: LGTM!

The changes to the peggy_denom and decimals values for the [MILK] section are consistent with the shift towards a factory-based naming convention.


1985-1986: LGTM!

The changes to the peggy_denom and decimals values for the [NOBI] section are consistent with the shift towards a factory-based naming convention.


2209-2210: LGTM!

The changes to the peggy_denom and decimals values for the [PYUSD] section are consistent with the shift towards a factory-based naming convention.


2245-2246: LGTM!

The changes to the peggy_denom and decimals values for the [QAT] section are consistent with the shift towards a factory-based naming convention.


2425-2426: LGTM!

The changes to the peggy_denom and decimals values for the [SHURIKEN] section are consistent with the shift towards a factory-based naming convention.


2461-2462: LGTM!

The changes to the peggy_denom and decimals values for the [SOL] section are consistent with the shift towards a factory-based naming convention.


2969-2970: LGTM!

The changes to the peggy_denom and decimals values for the [USDC] section are consistent with the shift towards a factory-based naming convention.


2985-2986: LGTM!

The changes to the peggy_denom and decimals values for the [USDCet] section are consistent with the shift towards a factory-based naming convention.


3005-3006: LGTM!

The changes to the peggy_denom and decimals values for the [USDT] section are consistent with the shift towards a factory-based naming convention.


3061-3062: LGTM!

The changes to the peggy_denom and decimals values for the [Unknown] section are consistent with the shift towards a factory-based naming convention.


8536-8539: LGTM!

The new entries [factory/inj1jfuyujpvvkxq4566r3z3tv3jdy29pqra5ln0yk/kira] and [factory/inj1jfuyujpvvkxq4566r3z3tv3jdy29pqra5ln0yk/kirat] are consistent with the shift towards a factory-based naming convention.


8780-8783: LGTM!

The new entries [factory/inj1lhr06p7k3rdgk0knw5hfsde3fj87g2aq4e9a52/binj] and [factory/inj1ljsmrpm3hlth5zk347lqr23rdzm2ktd4aathkl/position] are consistent with the shift towards a factory-based naming convention.


9720-9723: LGTM!

The new entries [factory/inj1s9dzsqrrq09z46ye7ffa9fldg3dt0e2cvx6yla/auction.0] and [factory/inj1sa2wmd8zhf893ex6da8jgnp06pcj2tv59mq457/position] are consistent with the shift towards a factory-based naming convention.


9752-9755: LGTM!

The new entries `[factory/inj1sg3yjgjlwhtre

@aarmoa aarmoa merged commit 716a628 into dev Jul 30, 2024
12 checks passed
@aarmoa aarmoa deleted the fix/solve_token_list_parsing_issue branch July 30, 2024 15:19
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.

1 participant