fix: remove oa v3 function#244
Conversation
📝 WalkthroughWalkthroughThis PR removes OpenAttestation v3 legacy/experimental references and examples, standardizing documentation and examples to OpenAttestation v2 across how-tos and reference pages, and updates an XDC gas API endpoint used by a frontend hook. ChangesOpenAttestation v3 documentation cleanup
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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.
🧹 Nitpick comments (1)
src/components/ContractCost/hooks/useFetchGasPrice.tsx (1)
46-48: 💤 Low valueConsider validating the response structure before parsing.
If the endpoint returns an unexpected response format,
parseInt(respData.result, 16)will throw. Adding validation would make the error handling more explicit and prevent silent failures.🛡️ Optional defensive validation
const respData = await resp.json(); + if (!respData?.result) { + throw new Error("Invalid response: missing result field"); + } const gasPriceInWei = parseInt(respData.result, 16); return gasPriceInWei / 1e9;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/ContractCost/hooks/useFetchGasPrice.tsx` around lines 46 - 48, The code currently calls parseInt(respData.result, 16) without validating respData or respData.result, which can throw on unexpected responses; update the fetch logic in useFetchGasPrice (the resp, respData, gasPriceInWei handling) to first check resp.ok and that respData is an object with a string-typed result (e.g., typeof respData?.result === 'string'), and if validation fails either throw a clear Error or return a sensible fallback; also surround the parseInt conversion with a try/catch to surface a descriptive error (including the actual respData) so failures are explicit rather than silent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/components/ContractCost/hooks/useFetchGasPrice.tsx`:
- Around line 46-48: The code currently calls parseInt(respData.result, 16)
without validating respData or respData.result, which can throw on unexpected
responses; update the fetch logic in useFetchGasPrice (the resp, respData,
gasPriceInWei handling) to first check resp.ok and that respData is an object
with a string-typed result (e.g., typeof respData?.result === 'string'), and if
validation fails either throw a clear Error or return a sensible fallback; also
surround the parseInt conversion with a try/catch to surface a descriptive error
(including the actual respData) so failures are explicit rather than silent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e0b8064b-f9ee-413e-9fe1-f87bbd9d10ca
📒 Files selected for processing (1)
src/components/ContractCost/hooks/useFetchGasPrice.tsx
fix: remove OA v3
Removes OpenAttestation v3 references from documentation while retaining OA v3 verification support.
Changes
getting-started.md— UpdatedsignOAdescription to reflect v2 onlyattachments.md— Removed OA v3 legacy format section and v3 field referencesimplementing-qr-codes.md— Removed OA v3 QR code example andcredentialSubject.links.self.hrefreferencedecentralized-renderer.md— Removed V3 from supported formats; commented outBillOfLadingSchemaV3type,v3import, andTemplateASampleV3sample usageSummary by CodeRabbit