Closed kemuru closed 2 weeks ago
These updates significantly enhance the validation and schema structure within the Kleros SDK. New utility functions for validating hexadecimal strings improve address validation, while several schema fields have been made optional to increase flexibility. The transition to a record type for aliases and the temporary use of strings for addresses indicate a clear path for future enhancements, ensuring the SDK remains robust and adaptable.
File | Change Summary |
---|---|
kleros-sdk/src/dataMappings/utils/disputeDetailsSchema.ts | Added isHexAddress and isHexId validation functions; made fields optional in AnswerSchema and DisputeDetailsSchema ; changed AliasSchema to a record type; updated address fields to temporary string usage. |
kleros-sdk/src/dataMappings/utils/populateTemplate.ts | Replaced DisputeDetailsValidator with DisputeDetailsSchema for validation, updating the logic accordingly. |
kleros-sdk/src/dataMappings/executeActions.ts | Changed parameter from context.arbitrable to context.arbitrableAddress in executeAction function. |
web/src/hooks/queries/usePopulatedDisputeData.ts | Renamed arbitrable to arbitrableAddress and introduced arbitrableChainID based on dispute context. |
web/src/pages/DisputeTemplateView/index.tsx | Renamed properties arbitrator and arbitrable to arbitratorAddress and arbitrableAddress in initialContext . |
In the land of code where bits align,
Hex checks bloom on the vine.
Fields optional, schemas wise,
Flexibility now takes the prize.
Bugs beware, for we refine,
Our dispute chain divine. π°π»π
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?
Name | Link |
---|---|
Latest commit | df2b3d92476369e08712810c9da434a3e7ba6dca |
Latest deploy log | https://app.netlify.com/sites/kleros-v2-university/deploys/66aa7d5a4421ef0008c64cf7 |
Deploy Preview | https://deploy-preview-1635--kleros-v2-university.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Name | Link |
---|---|
Latest commit | df2b3d92476369e08712810c9da434a3e7ba6dca |
Latest deploy log | https://app.netlify.com/sites/kleros-v2-neo/deploys/66aa7d5a431f5c000845a8be |
Deploy Preview | https://deploy-preview-1635--kleros-v2-neo.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Name | Link |
---|---|
Latest commit | df2b3d92476369e08712810c9da434a3e7ba6dca |
Latest deploy log | https://app.netlify.com/sites/kleros-v2-testnet/deploys/66aa7d5b971ba700070167dc |
Deploy Preview | https://deploy-preview-1635--kleros-v2-testnet.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Code Climate has analyzed commit df2b3d92 and detected 2 issues on this pull request.
Here's the issue category breakdown:
Category | Count |
---|---|
Style | 2 |
View more on Code Climate.
Issues
2 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
regarding zod, I've put some logs detailing exactly why the template validation failed in case it did, you can check with F12 when you're inside a dispute
Summary by CodeRabbit
Summary by CodeRabbit
New Features
isHexAddress
andisHexId
functions.Improvements
attachment
,frontendUrl
,category
,lang
,specification
,aliases
).arbitrableChainID
for better context in dispute data.Refactor
DisputeDetailsSchema
for improved consistency and error handling.arbitrable
toarbitrableAddress
).PR-Codex overview
The focus of this PR is to update addresses and add validation in dispute-related functionalities.
Detailed summary
DisputeDetailsValidator
withDisputeDetailsSchema
for validationDEFAULT_CHAIN
import for cross-chain disputesdisputeDetailsSchema
AnswerSchema
andAliasSchema
DisputeDetailsSchema