-
Notifications
You must be signed in to change notification settings - Fork 20
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/support custom chain for EVM wallet #1235
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
6 Skipped Deployments
|
Caution Review failedThe pull request is closed. WalkthroughThe changes update documentation and modify several hooks and components to support EVM custom chain IDs. The Changes
Possibly related PRs
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
src/lib/pages/deploy-script/index.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-react". (The package "eslint-plugin-react" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-react" was referenced from the config file in ".eslintrc.json". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. src/lib/pages/evm-contract-verify/index.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-react". (The package "eslint-plugin-react" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-react" was referenced from the config file in ".eslintrc.json". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. src/lib/pages/evm-contract-verify/components/ContractLibrary.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-react". (The package "eslint-plugin-react" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-react" was referenced from the config file in ".eslintrc.json". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
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: 1
🧹 Nitpick comments (1)
src/lib/app-provider/hooks/useSignAndBroadcastEvm.ts (1)
74-79
: Add input validation for feeDenom.While the code handles undefined cases, it would be beneficial to validate the feeDenom format before slicing.
-const feeDenom = data?.params.feeDenom.slice(-40) ?? ""; +const feeDenom = data?.params.feeDenom?.match(/[0-9a-fA-F]{40}$/)?.[0] ?? "";
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
CHANGELOG.md
(1 hunks)src/lib/app-provider/hooks/useExampleAddresses.ts
(1 hunks)src/lib/app-provider/hooks/useSignAndBroadcastEvm.ts
(2 hunks)src/lib/pages/deploy-script/index.tsx
(2 hunks)src/lib/pages/evm-contract-verify/components/ContractLibrary.tsx
(3 hunks)src/lib/pages/evm-contract-verify/index.tsx
(3 hunks)src/lib/utils/evm.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (7)
src/lib/app-provider/hooks/useExampleAddresses.ts (1)
1-32
: LGTM! Clean and well-structured hook implementation.The hook follows React best practices with proper memoization and type safety.
src/lib/pages/evm-contract-verify/components/ContractLibrary.tsx (1)
20-20
: LGTM! Proper address format conversion.The changes correctly handle the conversion from Bech32 to hex format for the example address.
Also applies to: 45-45
src/lib/pages/deploy-script/index.tsx (1)
41-41
: Verify the impact of the WebAssembly configuration.The
useWasmConfig
hook is added withshouldRedirect: true
. Please ensure that:
- The redirection behavior is tested for both valid and invalid WebAssembly configurations.
- The user experience is smooth when redirection occurs.
src/lib/pages/evm-contract-verify/index.tsx (1)
82-82
: LGTM! Consistent address format handling.The changes maintain consistency with other components in handling address format conversion from Bech32 to hex.
Also applies to: 248-248
src/lib/app-provider/hooks/useSignAndBroadcastEvm.ts (2)
9-9
: LGTM! New imports and variables support custom chain functionality.The added imports and variable declarations are necessary for supporting custom EVM chains, providing access to chain parameters and configuration.
Also applies to: 57-61, 63-64
70-72
: LGTM! Proper chain ID formatting.The chain ID is now correctly formatted with "0x" prefix for EVM compatibility.
src/lib/utils/evm.ts (1)
102-102
: LGTM! Improved type consistency.Changed from
toFixed()
totoNumber()
to return a numeric chain ID, which is more appropriate for the EVM chain ID calculation.
Summary by CodeRabbit
Bug Fixes
New Features