Skip to content
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

SDK: data mappings (WIP) #1165

Merged
merged 45 commits into from
Jan 23, 2024
Merged

SDK: data mappings (WIP) #1165

merged 45 commits into from
Jan 23, 2024

Conversation

kemuru
Copy link
Contributor

@kemuru kemuru commented Aug 17, 2023

PR-Codex overview

This PR focuses on updating dependencies, adding new features, and improving code structure.

Detailed summary

  • Updated @dappnode/dappnodesdk dependency to version 0.3.11.
  • Added MAX_BYTE_SIZE constant in consts.ts.
  • Added INVALID_DISPUTE_DATA_ERROR constant in index.ts.
  • Added new fields version and metadata in dispute template JSON files.
  • Updated environment variables in .env.example and .env.devnet.public.
  • Added new functions and types in various files.
  • Added new tests and test scripts.
  • Improved code structure and formatting.

The following files were skipped due to too many changes: kleros-sdk/src/dataMappings/actions/callAction.ts, kleros-sdk/config/v2-disputetemplate/escrow/DataMappings.escrow.jsonc, kleros-sdk/src/dataMappings/disputeDetails.ts, kleros-sdk/package.json, web/package.json, kleros-sdk/config/v2-disputetemplate/reality/example3/DisputeTemplate.json.mustache, kleros-sdk/src/dataMappings/actions/eventAction.ts, kleros-sdk/src/dataMappings/utils/actionTypes.ts, kleros-sdk/src/dataMappings/actions/fetchIpfsJsonAction.ts, kleros-sdk/src/dataMappings/utils/DisputeDetailsValidator.ts, kleros-sdk/src/dataMappings/dataMapping.json, kleros-sdk/config/v2-disputetemplate/reality/example3/DisputeMappings.json, kleros-sdk/config/v2-disputetemplate/escrow/DisputeDetails.escrow.jsonc.mustache, kleros-sdk/config/v2-disputetemplate/moderate/DisputeDetails.moderate.json, kleros-sdk/src/dataMappings/utils/actionTypeValidators.ts, kleros-sdk/src/dataMappings/utils/disputeDetailsSchema.ts, kleros-sdk/src/dataMappings/executeActions.ts, kleros-sdk/config/v2-disputetemplate/NewDisputeTemplate.schema.json, kleros-sdk/src/dataMappings/decoder.ts, web/src/components/DisputeCard/index.tsx, kleros-sdk/src/dataMappings/retrieveRealityData.ts, web/src/components/DisputePreview/DisputeContext.tsx, kleros-sdk/src/dataMappings/dataMapping.ts, kleros-sdk/test/disputeDetailsSchema.test.ts, web/src/pages/Cases/CaseDetails/Overview/index.tsx, kleros-sdk/config/v1-metaevidence/escrow3.json, web/src/pages/DisputeTemplateView.tsx, kleros-sdk/test/dataMappings.test.ts, contracts/scripts/disputeCreatorBot.ts, yarn.lock

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@netlify
Copy link

netlify bot commented Aug 17, 2023

Deploy Preview for kleros-v2 failed.

Name Link
🔨 Latest commit 7001003
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2/deploys/65b00e6ef29c66000884ea62

@netlify
Copy link

netlify bot commented Aug 17, 2023

Deploy Preview for kleros-v2-contracts ready!

Name Link
🔨 Latest commit 84bea91
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-contracts/deploys/64e36c257c71ea0008e7b284
😎 Deploy Preview https://deploy-preview-1165--kleros-v2-contracts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jaybuidl jaybuidl linked an issue Aug 23, 2023 that may be closed by this pull request
@kemuru kemuru changed the title feat(sdk): draft of some actions in web utils feat(sdk): data mappings actions Aug 31, 2023
@jaybuidl jaybuidl changed the title feat(sdk): data mappings actions SDK: data mappings (WIP) Jan 23, 2024
Copy link

codeclimate bot commented Jan 23, 2024

Code Climate has analyzed commit 7001003 and detected 61 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 3
Duplication 9
Style 49

View more on Code Climate.

@jaybuidl jaybuidl marked this pull request as ready for review January 23, 2024 19:08
Copy link

sonarcloud bot commented Jan 23, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

14 New issues
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@jaybuidl
Copy link
Member

Work will continue on a different branch.

DONE

  • a rudimentary implementation of the data mappings in kleros-sdk/src/dataMappings/actions
  • sdk basic data types, schema validator (Zod) and tests (Vitest)
  • court display of the case details using the sdk: by executing the data mappings and populating the dispute template.
  • dispute preview for development purposes at route #disputeTemplate in web/src/pages/DisputeTemplateView
  • the web package now depends on kleros-sdk instead of contracts
  • the kleros-sdk package depends on contracts

TODO

  • consolidate kleros-sdk/config/v2-disputetemplate, escrow is the most up-to-date.
  • consolidate the types between
    • web/src/context/NewDisputeContext.IDisputeTemplate used by the Dispute Resolver
    • kleros-sdk/src/dataMappings/utils/disputeDetailsTypes
  • use the dispute context info more explicitly, don't hardhat arbitrable addresses like in kleros-sdk/src/dataMappings/decoder.ts
  • the dispute preview page should provide input fields for the context info.
  • more

@jaybuidl jaybuidl merged commit ab6dabd into dev Jan 23, 2024
8 of 13 checks passed
@jaybuidl jaybuidl deleted the feat(sdk)/data-mappings branch January 23, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dispute template data mappings Dispute Preview (dev tool)
3 participants