Fix/issues 399 400 401 402#413
Merged
hman38705 merged 4 commits intosolutions-plug:mainfrom Mar 29, 2026
Merged
Conversation
…tions-plug#401) Single canonical cancel_market_admin function remains in lib.rs, delegating to modules::cancellation::cancel_market_admin. Added doc comment to make the canonical entrypoint explicit. ABI is unchanged.
…age (solutions-plug#402) Single get_dispute_window implementation in modules/resolution.rs using DEFAULT_DISPUTE_WINDOW_SECONDS (72h). Removed undefined DISPUTE_WINDOW_SECONDS reference. Added unit tests covering default value, configured value, and minimum-clamp enforcement.
…lutions-plug#399) ApiError now includes a machine-readable 'code' field alongside 'message'. Error constructors (internal, bad_request, not_found, conflict, rate_limited) ensure all handlers map errors consistently. OpenAPI ApiError schema updated to require both 'code' and 'message' fields with example values.
…mes (solutions-plug#400) - Server URL updated from localhost:3001 to localhost:8080 to match default API_BIND_ADDR (0.0.0.0:8080) in config.rs - ApiKeyAuth security scheme declared (X-API-Key header) - Security applied to all admin routes: resolveMarket, emailPreview, emailSendTest, getEmailAnalytics, getEmailQueueStats - Contract tests added (openapi_contract_test.rs) validating spec-vs-runtime route parity, server URL, security scheme declaration, and ApiError schema
|
@chukwudiikeh 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.
fix: resolve API/contract drift, duplicate entrypoints, and error schema gaps (#399 #400 #401 #402)
This PR addresses four open issues across the backend API and smart contracts:
Add structured API error codes and consistent error schema #399 — ApiError now includes a machine-readable code field. All internal errors map through typed constructors (internal, bad_request, not_found,
conflict, rate_limited), eliminating freeform-only error responses. OpenAPI schema updated accordingly.
Sync OpenAPI with runtime configuration and auth #400 — OpenAPI server URL corrected to localhost:8080 (matching the API_BIND_ADDR default). ApiKeyAuth security scheme declared and applied to all
admin routes. Contract tests added to enforce spec-vs-runtime route parity going forward.
Remove duplicate cancel_market_admin entrypoint #401 — Single canonical cancel_market_admin entrypoint confirmed in lib.rs. Doc comment added for clarity. ABI is backward-compatible.
Fix duplicate get_dispute_window and dead constant usage #402 — Single get_dispute_window implementation in modules/resolution.rs using the correctly named DEFAULT_DISPUTE_WINDOW_SECONDS constant. Unit
tests added for default value, configured override, and minimum-clamp behavior.
Closes #399
Closes #400
Closes #401
Closes #402