Skip to content

Subgraph: added SortitionModule to data sources #1372

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

Harman-singh-waraich
Copy link
Contributor

@Harman-singh-waraich Harman-singh-waraich commented Dec 19, 2023

  1. Added sortitionModule as dataSource to subgraph
  2. updated the UpdateJurorStake function to use SortitionModule as contract , since getJurorBalance is now a function in SortitionModule.
  3. Updated the events and handlers, StakeSet. ,etc now handled in ./src/SortitionModule.ts
  4. Tried to test locally , but local stack fails, upon calling "yarn simulate:local" in contracts directory the command fails due to "ArbitrationExampleEthFee" not existing as the contract is not in the arbitration/examples.
  5. Trying to test the subgraph with "yarn test" but thats running into errors too.

PR-Codex overview

This PR focuses on adding test cases for the SortitionModule and making updates to the JurorTokensPerCourt and SortitionModule files.

Detailed summary

  • Added test cases for the SortitionModule in the sortition-module.test.ts file.
  • Imported necessary dependencies in the test file.
  • Created a new function createStakeSetEvent in the sortition-module-utils.ts file.
  • Updated the JurorTokensPerCourt file to import the SortitionModule contract.
  • Updated the updateJurorStake function in the JurorTokensPerCourt file to use the SortitionModule contract.
  • Updated the handleStakeSet function in the SortitionModule file to use the SortitionModule contract.

The following files were skipped due to too many changes: subgraph/tests/sortition-module-utils.ts, subgraph/subgraph.yaml

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

Copy link

netlify bot commented Dec 19, 2023

Deploy Preview for kleros-v2 ready!

Name Link
🔨 Latest commit 0ff6046
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2/deploys/65834185b3bf360008840509
😎 Deploy Preview https://deploy-preview-1372--kleros-v2.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 force-pushed the chore(subgraph)/migrate-subgraph-for-instant-staking branch from b1420c6 to 0ff6046 Compare December 20, 2023 19:33
@jaybuidl jaybuidl changed the base branch from dev to chore(web)/migrate-frontend-chain-to-arb-sepolia December 20, 2023 19:33
@jaybuidl jaybuidl added this to the testnet-3 milestone Dec 20, 2023
Copy link

codeclimate bot commented Dec 20, 2023

Code Climate has analyzed commit 0ff6046 and detected 49 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 10
Duplication 13
Style 26

View more on Code Climate.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions

0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@jaybuidl jaybuidl marked this pull request as ready for review December 20, 2023 19:35
@jaybuidl jaybuidl changed the title chore: add-sortition-module-as-dataSource Subgraph: added SortitionModule to data sources Dec 20, 2023
@jaybuidl jaybuidl merged commit 0ff6046 into chore(web)/migrate-frontend-chain-to-arb-sepolia Dec 20, 2023
@jaybuidl jaybuidl deleted the chore(subgraph)/migrate-subgraph-for-instant-staking branch December 20, 2023 19:37
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.

Migrate the subgraph to support the latest instant-staking contract changes
2 participants