-
Notifications
You must be signed in to change notification settings - Fork 3
Fix(web)/wagmi generate #78
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
Conversation
WalkthroughThis update modifies dependency versions for the Changes
Sequence Diagram(s)sequenceDiagram
participant ConfigLoader as getConfig
participant ArbitratorImports as @kleros/kleros-v2-contracts/cjs/deployments
participant ArtifactReader as readArtifacts
participant Result as ContractConfigArray
ConfigLoader->>ArbitratorImports: Import arbitratorContracts for environment
ConfigLoader->>ArtifactReader: Call readArtifacts(viemChainName, hardhatChainName, arbitratorContracts)
ArtifactReader->>Result: Add contract configs using addArbitratorContract
ArtifactReader-->>ConfigLoader: Return contract configs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (7)
💤 Files with no reviewable changes (1)
🧰 Additional context used🧬 Code Graph Analysis (6)web/src/pages/SubmitList/AdvancedParameters/ArbitrationParameters.tsx (1)
web/src/components/ActionButton/Modal/ChallengeItemModal.tsx (1)
web/src/pages/SubmitList/NavigationButtons/SubmitListButton.tsx (1)
web/src/components/ActionButton/Modal/RemoveModal.tsx (1)
web/src/components/ActionButton/Modal/ResubmitModal.tsx (1)
web/src/pages/SubmitItem/Header/index.tsx (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🔇 Additional comments (12)
🪧 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 (
|
✅ Deploy Preview for curate-v2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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)
web/wagmi.config.ts (1)
15-36
: Good type definition for arbitrator contracts.Adding a strict type definition for
ArbitratorContracts
improves type safety and code clarity. The structure clearly defines the expected contract interfaces.Consider using more specific types for the ABI arrays instead of
any[]
for improved type safety:- abi: any[]; + abi: readonly unknown[];
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (3)
contracts/package.json
(1 hunks)web/package.json
(1 hunks)web/wagmi.config.ts
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Redirect rules - curate-v2
- GitHub Check: Header rules - curate-v2
- GitHub Check: Pages changed - curate-v2
🔇 Additional comments (8)
contracts/package.json (1)
89-89
: Version update aligns with web package.json changes.The dependency version update for
@kleros/kleros-v2-contracts
from^0.9.2
to^0.9.3
aligns with the same package update in the web project. This version bump supports the refactoring inweb/wagmi.config.ts
.web/package.json (1)
50-50
: Significant version bump of kleros-v2-contracts package.The
@kleros/kleros-v2-contracts
package has been updated from^0.3.2
to^0.9.3
, which is a larger version jump compared to the contracts package. This update is necessary to support the new direct import of arbitrator deployment data inwagmi.config.ts
.web/wagmi.config.ts (6)
7-11
: Improved arbitrator contract import approach.Instead of reading JSON files from the filesystem, the code now directly imports deployment data from the package. This is a more maintainable approach and reduces filesystem dependencies.
38-56
: Good helper function for DRY code.Creating the
addArbitratorContract
helper function improves code organization and follows the DRY principle by extracting common logic for adding contract configurations.
58-62
: Function signature update with improved typing.The function signature has been updated to make the
hardhatChainName
parameter mandatory and to accept the newarbitratorContracts
parameter with proper typing.
89-100
: Clean implementation using the new contract structure.The code elegantly extracts the necessary contract data and efficiently adds each contract to the results array using the helper function. This implementation is cleaner than the previous approach of reading JSON files.
108-124
: Proper environment-based contract selection.The implementation correctly selects the appropriate arbitrator contracts based on the deployment environment, maintaining the same behavior as before but with the new direct import approach.
129-129
: Updated function call with new parameter.The call to
readArtifacts
has been updated to pass the arbitrator contracts, completing the refactoring.
PR-Codex overview
This PR updates the arbitration cost handling in the application by replacing the old
useArbitrationCost
hook with a newuseReadKlerosCoreArbitrationCost
hook, reflecting changes in the dependency version and improving the way arbitration costs are fetched.Detailed summary
web/src/hooks/useArbitrationCostFromKlerosCore.ts
.@kleros/kleros-v2-contracts
version from^0.9.2
to^0.9.3
incontracts/package.json
andweb/package.json
.useArbitrationCost
withuseReadKlerosCoreArbitrationCost
in multiple files:web/src/pages/SubmitItem/Header/index.tsx
web/src/pages/SubmitList/AdvancedParameters/ArbitrationParameters.tsx
web/src/components/ActionButton/Modal/ChallengeItemModal.tsx
web/src/components/ActionButton/Modal/ResubmitModal.tsx
web/src/components/ActionButton/Modal/RemoveModal.tsx
web/src/pages/SubmitList/NavigationButtons/SubmitListButton.tsx
Summary by CodeRabbit