-
Notifications
You must be signed in to change notification settings - Fork 49
chore: effective stake instead of specific court stake, and effective number of staked jurors (counting child courts) #1951
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 introduces two new fields, Changes
Sequence Diagram(s)sequenceDiagram
participant UI as "Court Details Page"
participant Hook as "useCourtDetails Hook"
participant API as "GraphQL Server"
participant Stats as "Stats Formatter"
UI->>Hook: Request court details by ID
Hook->>API: Execute GraphQL query (includes effectiveStake and effectiveNumberStakedJurors)
API-->>Hook: Respond with court details (effectiveStake and effectiveNumberStakedJurors included)
Hook-->>UI: Return full court details data
UI->>Stats: Render stats using effectiveStake for "PNK Staked" and effectiveNumberStakedJurors for "Active Jurors"
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🪧 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 kleros-v2-neo failed. Why did it fail? →
|
✅ Deploy Preview for kleros-v2-testnet ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
❌ Deploy Preview for kleros-v2-university failed. Why did it fail? →
|
✅ Deploy Preview for kleros-v2-testnet-devtools 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/src/hooks/queries/useHomePageQuery.ts (1)
14-14
: Pagination limit added to counters queryAdding a
first: 1000
limit to the counters query is a good practice to prevent potentially large data transfers. This improves query performance and reduces network load.Consider implementing proper pagination with cursor-based navigation if you expect the number of counters to grow beyond 1000 in the future.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)
📒 Files selected for processing (1)
web/src/hooks/queries/useHomePageQuery.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (12)
- GitHub Check: Redirect rules - kleros-v2-university
- GitHub Check: Redirect rules - kleros-v2-neo
- GitHub Check: Header rules - kleros-v2-university
- GitHub Check: Header rules - kleros-v2-neo
- GitHub Check: Pages changed - kleros-v2-university
- GitHub Check: Pages changed - kleros-v2-neo
- GitHub Check: Redirect rules - kleros-v2-testnet-devtools
- GitHub Check: Header rules - kleros-v2-testnet-devtools
- GitHub Check: Pages changed - kleros-v2-testnet-devtools
- GitHub Check: contracts-testing
- GitHub Check: SonarCloud
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
web/src/hooks/queries/useHomePageQuery.ts (1)
22-22
: Pagination limit added to courts queryAdding a
first: 1000
limit to the courts query aligns with the changes made to the counters query and follows GraphQL best practices for query optimization.This change complements the new
effectiveStake
andeffectiveNumberStakedJurors
fields introduced in the schema, ensuring consistent data fetching patterns across the application.
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.
lgtm
Code Climate has analyzed commit 0cc67e1 and detected 2 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
|
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.
lgtm
subgraph, frontend changes
PR-Codex overview
This PR primarily focuses on enhancing the handling of "effective" stakes and jurors in the Kleros subgraph, introducing new fields and updating functions to manage effective stakes more efficiently.
Detailed summary
version
insubgraph/package.json
from0.15.0
to0.15.2
.effectiveNumberStakedJurors
andeffectiveStake
fields insubgraph/core/schema.graphql
.web/src/hooks/queries/useHomePageQuery.ts
to includefirst
parameter forcounters
andcourts
.web/src/pages/Courts/CourtDetails/Stats/stats.ts
to useeffectiveStake
instead ofstake
.updateEffectiveStake
function insubgraph/core/src/entities/Court.ts
to accept adelta
parameter.createCourtFromEvent
to initializeeffectiveNumberStakedJurors
.updateJurorEffectiveStake
to include adelta
parameter and updated logic for effective juror stakes.updateEffectiveStake
andupdateJurorEffectiveStake
to pass thedelta
value.Summary by CodeRabbit
New Features
Bug Fixes
Chores