Jobsunday002 fixes - #572
Merged
Merged
Conversation
Additive helper module for O(1) approval checks and 8-byte storage instead of a 1.6KB Vec<Address> for 50 verifiers. Not yet wired into approve_and_mint.
Verifies admin initialization and credit_registry->retirement wiring via the Soroban CLI, complementing the existing HTTP-only smoke test.
Standalone shimmer skeleton to show while GET /api/v1/credits is in flight, avoiding a blank screen during the 1-2s initial fetch.
Additive NestJS ExceptionFilter returning { code, message, details }
instead of the default unstructured body, enabling localized/
context-specific frontend error handling.
|
@josunday002 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #531
closes #532
closes #533
closes #534
Why this matters now: DataKey::CreditApprovals(credit_id) stores Vec of all verifiers who approved. With 50 registered verifiers and 3 approvals required, this Vec grows to 50 addresses (1.6KB) per credit. Iterating and checking membership in approve_and_mint wastes gas. A bitmap (50 bits = 8 bytes) is 200x smaller.
Problem / What: contracts/credit_registry/src/storage.rs — get_credit_approvals returns Vec. The approvals.contains(&verifier) check in approve_and_mint is O(n).
Why this matters now: Frontend receives 400 Bad Request with { message: "Invalid tonnes" } but has no way to distinguish this from other validation errors. Can't show localized error messages or context-specific retry guidance. Structured errors enable better UX.
Problem / What: api/src/ uses NestJS's default exception handling which returns unstructured error messages. Need standardized error response: { code: string, message: string, details?: object }.