Fix/issues 407 408 409 410#416
Merged
hman38705 merged 6 commits intosolutions-plug:mainfrom Mar 29, 2026
Merged
Conversation
…contract queries - Add MAX_PAGE_LIMIT = 100 constant to queries module - Clamp limit param in get_markets, get_markets_by_status, get_guardians_paginated - Document truncation behaviour in each function's doc-comment - Add inline tests: clamping to max, status-filtered clamping, zero-limit
…tions-plug#407) - Introduce MAX_PAGE_LIMIT = 100 constant in queries.rs - Silently clamp limit in get_markets, get_markets_by_status, and get_guardians_paginated to prevent unbounded gas/memory usage - Expose get_markets, get_markets_by_status, get_guardians_paginated in lib.rs so callers can use the paginated API - Add unit tests: limit clamped to max, status filter clamped, zero limit returns empty slice
…s-plug#410) - Create API_SPEC.md with full method signatures including multi-oracle parameters (oracle_id, OracleConfig fields) - Error code table reflects all 50 ErrorCode enum values with correct numeric assignments - Event table lists all emitted events with exact topic symbols and data payloads sourced from events.rs - Remove duplicate emit_monitoring_state_reset definition in events.rs - Remove duplicate UpgradeStats and PendingGuardianRemoval structs in types.rs
- Create docs/README.md with links only to files that exist in the repo - Remove references to non-existent docs/security/SECURITY_BEST_PRACTICES.md and incorrect docs/ARCHITECTURE.md path - Link to API_SPEC.md and services/api/openapi.yaml which are present - Add repository layout overview reflecting the current directory tree
…s-plug#409) - Create services/api/DATABASE.md with correct table names and workspace-relative commands (no absolute paths) - Migration 002 updated to create newsletter_subscribers table with columns matching db.rs usage (confirmed, confirmation_token) instead of the stale newsletter_subscriptions schema (status) - Seed file 01 updated to insert into newsletter_subscribers with the correct column list - DATABASE.md documents the newsletter_subscribers vs newsletter_subscriptions naming discrepancy and provides a one-time ALTER TABLE migration path
|
@fejilaup-cloud 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.
PR Message
Title: fix: sync API spec, docs, pagination bounds, and database schema (#407 #408 #409 #410)
Body:
This PR resolves four maintenance issues across contracts and documentation.
#410 — API_SPEC refresh
Creates API_SPEC.md from the live source code. All 50 error codes carry their correct numeric values, all 21 contract events list their exact topic
symbols and data payloads, and method signatures include the current multi-oracle parameters (oracle_id, full OracleConfig struct). Also removes duplicate
function/struct definitions in events.rs and types.rs that would have caused compile errors.
#407 — Pagination hard bounds
Exposes the already-implemented get_markets, get_markets_by_status, and get_guardians_paginated query functions in lib.rs. All three silently clamp limit
to MAX_PAGE_LIMIT = 100, bounding per-call gas and memory regardless of dataset size. Tests cover: limit clamped to max, status-filtered limit clamped,
zero limit returns empty.
#408 — Docs index links
Creates docs/README.md with links only to files that exist in the repository. Removes stale references to docs/security/SECURITY_BEST_PRACTICES.md and
docs/ARCHITECTURE.md.
#409 — Database documentation
Creates services/api/DATABASE.md with workspace-relative psql commands, the correct ordered migration list, and per-table schema documentation. Fixes
migration 002 and seed 01 to use newsletter_subscribers — the table name the application code (db.rs) actually queries — reconciling the long-standing
newsletter_subscriptions vs newsletter_subscribers naming split.
Close #407
Close #408
Close #409
Close #410