-
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
Feat(components): add deployed bytecode #1204
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
6 Skipped Deployments
|
Caution Review failedThe pull request is closed. WalkthroughThis pull request introduces a new generic Changes
Possibly related PRs
Suggested reviewers
Poem
📜 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: 3
🔭 Outside diff range comments (1)
src/lib/services/evm/lcd.ts (1)
Line range hint
23-47
: Consider retrieving multiple transactionsThe function only looks at the first transaction, which might miss the relevant create event. Consider:
- Implementing pagination to look through more transactions
- Adding a parameter to control the number of transactions to search
- Adding proper error handling for when the create event is not found
🧹 Nitpick comments (5)
src/lib/pages/evm-contract-details/types.ts (1)
12-17
: Maintain consistent naming convention in enum valuesThe enum values should follow a consistent naming convention. Currently, "byteCode" uses camelCase while other values use lowercase.
export enum EvmContractDetailsContractTabs { Code = "code", Compiler = "compiler", Abi = "abi", - ByteCode = "byteCode", + ByteCode = "bytecode", }src/lib/pages/evm-contract-details/components/EvmContractDetailsContarct/ContractByteCode.tsx (2)
5-8
: Add validation for empty string propsConsider adding validation or placeholder text for when
code
ordeployedCode
are empty strings to improve user experience.
10-28
: Consider adding loading states for large bytecodeLarge bytecode strings might cause performance issues. Consider:
- Adding a loading state while rendering large strings
- Implementing virtualization for better performance
- Adding a truncate option with "Show More" button
Also, the component's directory has a typo: "Contarct" should be "Contract".
src/lib/pages/evm-contract-details/components/EvmContractDetailsContarct/index.tsx (1)
13-38
: Add error boundaries for component safetyConsider wrapping the component with error boundaries to gracefully handle rendering errors, especially for invalid bytecode or contract data.
src/lib/components/TypeSwitch.tsx (1)
43-43
: Consider making tab width responsive.The fixed width of
96px
might not accommodate longer tab names and could break the layout on smaller screens.Consider using a dynamic width approach:
- w="96px" + minW="96px" + flex="1"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
src/lib/components/TypeSwitch.tsx
(1 hunks)src/lib/pages/evm-contract-details/components/EvmContractDetailsBytecode.tsx
(0 hunks)src/lib/pages/evm-contract-details/components/EvmContractDetailsContarct/ContractByteCode.tsx
(1 hunks)src/lib/pages/evm-contract-details/components/EvmContractDetailsContarct/index.tsx
(1 hunks)src/lib/pages/evm-contract-details/index.tsx
(2 hunks)src/lib/pages/evm-contract-details/types.ts
(1 hunks)src/lib/pages/interact-contract/components/InteractionTypeSwitch.tsx
(0 hunks)src/lib/pages/interact-contract/components/index.ts
(0 hunks)src/lib/pages/interact-contract/index.tsx
(2 hunks)src/lib/services/evm/lcd.ts
(1 hunks)
💤 Files with no reviewable changes (3)
- src/lib/pages/interact-contract/components/index.ts
- src/lib/pages/evm-contract-details/components/EvmContractDetailsBytecode.tsx
- src/lib/pages/interact-contract/components/InteractionTypeSwitch.tsx
🔇 Additional comments (6)
src/lib/pages/evm-contract-details/components/EvmContractDetailsContarct/index.tsx (2)
24-24
: Address the TODO commentThe comment "TODO: Support all status" needs to be addressed. Please clarify the requirements and timeline for supporting all statuses.
Would you like me to help create an issue to track this TODO item?
33-35
: Implement remaining tab viewsOnly the ByteCode tab is currently implemented. The other tabs (Code, Compiler, Abi) defined in
EvmContractDetailsContractTabs
need to be implemented.✅ Verification successful
Review comment is accurate - missing tab implementations
The code confirms that while all tabs (Code, Compiler, Abi, ByteCode) are defined in
EvmContractDetailsContractTabs
and rendered in the UI viaTypeSwitch
, only the ByteCode tab has an actual implementation. The other three tabs need to be implemented:
- Code tab implementation missing
- Compiler tab implementation missing
- Abi tab implementation missing
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify if other tab implementations exist in the codebase rg -g '*.tsx' -g '*.ts' "EvmContractDetailsContractTabs\.(Code|Compiler|Abi)"Length of output: 79
Script:
#!/bin/bash # Find the enum definition and related components echo "=== Enum Definition ===" rg -g '*.ts*' "enum EvmContractDetailsContractTabs" echo -e "\n=== Related Components ===" fd -e tsx -e ts "(Code|Compiler|Abi|Contract)\.tsx$|/Contract.*\.tsx$" echo -e "\n=== Current Tab Usage ===" rg -g '*.tsx' "currentTab === EvmContractDetailsContractTabs" -A 2Length of output: 1711
Script:
#!/bin/bash # Get enum definition and component structure echo "=== Enum Definition Content ===" cat src/lib/pages/evm-contract-details/types.ts echo -e "\n=== Main Component Structure ===" cat src/lib/pages/evm-contract-details/components/EvmContractDetailsContarct/index.tsxLength of output: 2129
src/lib/services/evm/lcd.ts (1)
46-46
: Verify impact of return type changeThe addition of the
code
field to the return object might affect existing consumers of this function.src/lib/components/TypeSwitch.tsx (1)
6-11
: LGTM! Well-defined generic interface.The
TypeSwitchProps
interface is well-structured with clear generic constraints and optional properties.src/lib/pages/evm-contract-details/index.tsx (1)
143-146
: LGTM! Clean component replacement.The replacement of
EvmContractDetailsBytecode
withEvmContractDetailsContract
is well-implemented with proper prop passing.src/lib/pages/interact-contract/index.tsx (1)
153-157
: LGTM! Clean migration to TypeSwitch.The migration from
InteractionTypeSwitch
toTypeSwitch
is well-implemented, maintaining the same functionality while leveraging the new generic component.
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
🧹 Nitpick comments (1)
CHANGELOG.md (1)
42-42
: LGTM! The new changelog entry follows the established format.The entry is properly placed under the "Features" section and correctly linked to PR #1204.
Consider adding more details about what this feature enables users to do, for example:
-Add EVM contract details deployed bytecode +Add EVM contract details deployed bytecode view to inspect contract's on-chain bytecode
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
CHANGELOG.md
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
CHANGELOG.md (1)
Line range hint
1-1147
: LGTM! The changelog is well-structured and follows best practices.The file maintains:
- Clear categorization of changes
- Consistent formatting
- Proper versioning
- Good organization
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
🧹 Nitpick comments (1)
src/lib/services/types/tx.ts (1)
495-498
: Add JSDoc comments to document the schema.The schema definition is correct and well-structured. Consider adding JSDoc comments to document:
- The purpose of this schema
- The expected format of the
code
field (bytecode)- Example usage
+/** + * Schema for EVM contract creation messages. + * @property {string} type - The message type identifier + * @property {string} code - The contract bytecode to be deployed + * @example + * const msg = { + * type: "/minievm.evm.v1.MsgCreate", + * code: "0x608060405234801561001057600080fd5b50610..." + * }; + */ export const zEvmMsgCreate = z.object({ type: z.literal("/minievm.evm.v1.MsgCreate"), code: z.string(), });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/lib/services/evm/lcd.ts
(2 hunks)src/lib/services/types/tx.ts
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/lib/services/evm/lcd.ts
🔇 Additional comments (1)
src/lib/services/types/tx.ts (1)
178-178
: LGTM! Preserves message-specific fields.The spread operator ensures all message-specific fields are included in the transformed Message object.
Summary by CodeRabbit
New Features
TypeSwitch
component for tab navigation.ContractByteCode
component to display contract bytecode details.EvmContractDetailsContract
component for improved contract information display.Refactoring
InteractionTypeSwitch
with a more genericTypeSwitch
component.EvmContractDetailsBytecode
component.Improvements
EvmContractDetailsContractTabs
for more flexible tab management.