-
Notifications
You must be signed in to change notification settings - Fork 18
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/inj tia new msg #1004
Fix/inj tia new msg #1004
Conversation
WalkthroughThe pull request includes updates to the Changes
Possibly related PRs
Suggested reviewers
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 (
|
Quality Gate failedFailed conditions |
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: 1
🧹 Outside diff range and nitpick comments (1)
src/hooks/useTokenFee.ts (1)
Line range hint
149-158
: Add simulateOption parameter to getRouterConfig call.The getRouterConfig function signature was updated to accept simulateOption, but it's called without parameters here. This might cause undefined behavior.
- routerConfig: getRouterConfig() + routerConfig: getRouterConfig({ useIbcWasm: true })
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (3)
- package.json (1 hunks)
- src/hooks/useTokenFee.ts (5 hunks)
- src/pages/UniversalSwap/helpers.ts (2 hunks)
🧰 Additional context used
🔇 Additional comments (6)
package.json (1)
27-27
: Verify the dependency update and its implications.The version update of
@oraichain/oraidex-universal-swap
from 1.1.14 to 1.1.15 appears to be related to fixing Injective/TIA message handling.Let's verify the package version and changes:
Also, please ensure that the corresponding lock file (package-lock.json or yarn.lock) is updated to reflect this change.
src/hooks/useTokenFee.ts (4)
16-16
: LGTM! Import changes look good.The consolidation of helper functions under UniversalSwapHelper improves code organization and maintainability.
Also applies to: 21-21
71-73
: LGTM! Well-structured simulation options.The changes properly integrate:
- Protocol selection based on token types
- Conditional IBC WASM settings
- Router configuration with appropriate options
Also applies to: 82-97
74-81
: Verify the impact of setting ignoreFee to true.The simulateOption includes
ignoreFee: true
which might affect fee calculations. Please verify if this is intentional and doesn't impact the relayer fee calculations.#!/bin/bash # Search for other instances of ignoreFee usage rg "ignoreFee" --type ts
42-42
: Verify the EVM network check behavior remains unchanged.The migration to UniversalSwapHelper.isEvmNetworkNativeSwapSupported looks correct, but let's verify it maintains the same behavior.
✅ Verification successful
Let me generate additional scripts to verify the behavior by searching for both the old and new implementations.
Let's also check the previous implementation in the git history:
This will help us compare the old and new implementations to verify the behavior remains unchanged.
Based on the results, I can now generate the final response as we have sufficient evidence from the git history and codebase search.
The EVM network check behavior remains unchanged
The migration simply moves the
isEvmNetworkNativeSwapSupported
function from being a direct import to being accessed through theUniversalSwapHelper
class. The git history shows the exact replacement:
- Old:
isEvmNetworkNativeSwapSupported(fromChainId)
- New:
UniversalSwapHelper.isEvmNetworkNativeSwapSupported(fromChainId)
The function is used consistently across the codebase in similar contexts (useLoadTokens.ts, UniversalSwap/helpers.ts) for the same purpose - checking EVM network native swap support. The condition and its usage context remain identical, only the access method has changed as part of the refactoring.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for previous implementations to compare behavior rg -A 3 "isEvmNetworkNativeSwapSupported" --type tsLength of output: 485
Script:
#!/bin/bash # Search for UniversalSwapHelper class and its implementation ast-grep --pattern 'class UniversalSwapHelper { $$$ isEvmNetworkNativeSwapSupported($_) { $$$ } $$$ }' # Search for any other similar EVM network check implementations rg "isEvmNetwork.*Supported" --type ts -A 3Length of output: 2152
Script:
#!/bin/bash # Check git history for the specific line git log -p src/hooks/useTokenFee.ts | grep -A 5 -B 5 "isEvmNetwork.*Supported"Length of output: 3410
src/pages/UniversalSwap/helpers.ts (1)
395-396
:⚠️ Potential issueVerify the conflicting swap logic for Cosmos-based tokens
In the
isAllowAlphaIbcWasm
function, when bothfromToken
andtoToken
are Cosmos-based, the function returnstrue
, allowing swaps between Cosmos tokens:// cosmos -> cosmos if (toToken.cosmosBased && fromToken.cosmosBased) return true;However, in the
isAllowIBCWasm
function, when bothfromToken
andtoToken
are Cosmos-based, the function returnsfalse
, preventing swaps between Cosmos tokens:// cosmos -> cosmos if (fromTokenIsCosmos && toTokenIsCosmos) return false;Please verify if this discrepancy is intentional to ensure consistent swap behavior across the application.
Summary by CodeRabbit
New Features
Bug Fixes
Chores
@oraichain/oraidex-universal-swap
to ensure compatibility and access to the latest features.