-
Notifications
You must be signed in to change notification settings - Fork 423
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 Transmuter Contract Codes #3749
base: stage
Are you sure you want to change the base?
Conversation
@JohnnyWyles is attempting to deploy a commit to the OsmoLabs Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe recent update modifies the Changes
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🔇 Additional comments (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
packages/web/config/feature-flag.ts (1)
26-26
: Inconsistent Usage ofTransmuterPoolCodeIds
Across EnvironmentsThe
TransmuterPoolCodeIds
is used in both the client and server code, but there is an inconsistency in the IDs used across these environments. The server-side code does not include the new IDs ("814", "867", "996") added to the client-side configuration.
- File:
packages/server/src/queries/complex/pools/env.ts
- Line:
const TransmuterPoolCodeIds = IS_TESTNET ? ["3084"] : ["148"];
Ensure that the server-side logic is updated to reflect the same set of IDs as the client-side configuration to maintain consistency across environments.
Analysis chain
LGTM! But verify the usage of new TransmuterPoolCodeIds.
The addition of new IDs to
TransmuterPoolCodeIds
is consistent with the objective of enhancing filtering capabilities. Ensure that these new IDs are correctly utilized in the application logic.To verify, ensure that the application logic correctly handles these new IDs.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of new TransmuterPoolCodeIds in the codebase. # Test: Search for occurrences of the new IDs. Expect: Usage in relevant logic. rg --type js '814|867|996'Length of output: 111376
Script:
#!/bin/bash # Description: Search for the usage of TransmuterPoolCodeIds in the source files. # Test: Search for occurrences of TransmuterPoolCodeIds. Expect: Usage in relevant logic. rg --type js 'TransmuterPoolCodeIds'Length of output: 36
Script:
#!/bin/bash # Description: Search for the usage of TransmuterPoolCodeIds across all file types. # Test: Search for occurrences of TransmuterPoolCodeIds in all files. Expect: Usage in relevant logic. rg 'TransmuterPoolCodeIds'Length of output: 471
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 believe this is connected to legacy query code.
It's preferred to use this now:
const TransmuterPoolCodeIds = IS_TESTNET ? ["3084"] : ["148"]; |
This reverts commit c216e0a.
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
packages/server/src/queries/complex/pools/env.ts (1)
Line range hint
1-24
: Consider improvements for overall file structure and maintainability.While the changes to
TransmuterPoolCodeIds
are appropriate, here are some suggestions to improve the overall structure and maintainability of the file:
The WhitewhalePoolCodeIds for testnet is set to "?". If this information is available, please update it with the correct code ID.
Consider adding comments to explain the purpose of each constant and their relationships. This will help future maintainers understand the significance of these code IDs.
If more pool types are expected in the future, consider using a more structured approach for managing these constants. For example:
interface PoolCodeIds { testnet: string[]; mainnet: string[]; } const POOL_CODE_IDS: Record<string, PoolCodeIds> = { transmuter: { testnet: ["3084"], mainnet: ["148", "814", "867", "996"], }, astroportPcl: { testnet: ["8611"], mainnet: ["842"], }, whitewhale: { testnet: ["?"], // TODO: Update with correct testnet code ID mainnet: ["503", "641"], }, }; export function getCosmwasmPoolTypeFromCodeId(codeId: string): string { const environment = IS_TESTNET ? "testnet" : "mainnet"; for (const [poolType, ids] of Object.entries(POOL_CODE_IDS)) { if (ids[environment].includes(codeId)) { return `cosmwasm-${poolType}`; } } return "cosmwasm"; }This structure would make it easier to add new pool types and maintain the code IDs for different environments.
Would you like me to create a separate issue to track these improvements?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- packages/server/src/queries/complex/pools/env.ts (1 hunks)
🧰 Additional context used
🔇 Additional comments (2)
packages/server/src/queries/complex/pools/env.ts (2)
Line range hint
8-24
: LGTM: Function behavior correctly updated with new Transmuter pool code IDs.The
getCosmwasmPoolTypeFromCodeId
function will now correctly identify the new Transmuter pool types (3.0, 3.1, and 3.2) as "cosmwasm-transmuter". This change aligns with the PR objectives of enhancing filtering capabilities for Transmuter pools in the pools list.The existing logic in the function remains sound and will automatically accommodate the new code IDs without requiring any changes to the function itself.
4-4
: Verify the added Transmuter pool code IDs.The
TransmuterPoolCodeIds
constant has been updated to include additional code IDs for non-testnet environments. This change aligns with the PR objectives of adding new versions of Transmuter contracts (3.0, 3.1, and 3.2).However, to ensure accuracy and completeness:
- Please confirm that the new code IDs ("814", "867", "996") correspond to the correct versions (3.0, 3.1, and 3.2) of the Transmuter contracts.
- Consider adding comments to indicate which version each code ID represents for better maintainability.
To verify the correctness of these code IDs, you can run the following script:
This will help ensure that the added code IDs are consistent with other parts of the codebase and documentation.
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.
@JohnnyWyles if we could add // @deprecated use packages/server/src/queries/complex/pools/env.ts
comment above the old one, that would help prevent this confusion in the future
@JohnnyWyles is there any update on this? need any help? |
I think I did the change that Jon requested? |
Adding the 3 other contract uploads for Transmuter pools so that these can be filtered out in the pools list if wanted.
Transmuter 1.0 already listed
Transmuter 2.0 was never instantiated
This adds 3.0, 3.1 and 3.2 which are the alloyed asset pools - but also are transmuters and often dominate the volume charts.