Add Kleros tags to oracle feed badges#539
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request integrates Kleros address tags into the market oracle components, allowing for fallback labels and metadata to be displayed for unknown price feeds. The changes include updates to tooltips and oracle information displays to fetch and show Kleros-sourced tags. A logic issue was identified in MetaOracleInfo.tsx where the active oracle check could incorrectly evaluate to true while metadata is still loading.
| const { data: feedSnapshotsByAddress } = useFeedLastUpdatedByChain(chainId); | ||
|
|
||
| const metaData = getMetaOracleDataFromMetadata(oracleMetadataMap, oracleAddress, chainId); | ||
| const isPrimaryActive = Boolean(metaData?.currentOracle?.toLowerCase() === metaData?.primaryOracle?.toLowerCase()); |
There was a problem hiding this comment.
The logic for isPrimaryActive is fragile when metaData is null or undefined. Due to optional chaining, undefined === undefined evaluates to true, which means isPrimaryActive incorrectly defaults to true while metadata is still loading. Additionally, the Boolean() wrapper is redundant as the comparison already returns a boolean value. It's clearer to explicitly check for metaData.
| const isPrimaryActive = Boolean(metaData?.currentOracle?.toLowerCase() === metaData?.primaryOracle?.toLowerCase()); | |
| const isPrimaryActive = metaData ? metaData.currentOracle?.toLowerCase() === metaData.primaryOracle?.toLowerCase() : false; |
|
Closing this PR: after checking the current oracle metadata and market oracle/feed address sets against Kleros Scout, there is no live overlap to show. We are not integrating Kleros on oracle badges for now. |
Summary
Validation
Note: npx ultracite fix/check currently fail before scanning changed files because biome.jsonc contains unsupported rule keys.