Fix/config and horizon issues#62
Merged
Manuel1234477 merged 5 commits intoJun 26, 2026
Merged
Conversation
Hand-written openapi.yaml covers all implemented endpoints: POST/GET /payments, GET /payments/:id, GET /payments/:id/webhooks, POST /payments/:id/webhooks/:delivery_id/redeliver, and GET /health. Spec is served as JSON at /openapi.json (YAML parsed at startup via serde_yaml so the file stays the single source of truth). Swagger UI is served at /docs via a CDN-loaded HTML page pointing at /openapi.json.
This commit addresses 2 issues that were causing compilation errors: Issue 1: Config struct field mismatch - The Config struct in src/config.rs was missing the accepted_assets field and had an outdated usdc_issuer field. The verify() function in src/horizon.rs was updated to use the new accepted_assets field which supports multiple configurable assets (XLM, USDC, and any custom assets). - Added AcceptedAsset struct with code and issuer fields - Added AcceptedAsset::parse_list() to parse comma-separated asset config - Added AcceptedAsset::default_list() returning XLM and USDC defaults - Updated Config::from_env() to read ACCEPTED_ASSETS env var - Updated Config::Debug impl to include accepted_assets and rate_limit_requests_per_sec - Updated test config in src/config.rs to use accepted_assets - Added listener_mode field to Config struct (was missing) Issue 2: Timestamp normalization inconsistency - The row_to_webhook_delivery() function in src/db.rs was not normalizing the created_at timestamp, while row_to_payment() was. This caused webhook delivery timestamps to potentially be in the old format (space separator, no Z suffix) instead of strict RFC 3339 UTC. - Applied normalize_ts() to created_at in row_to_webhook_delivery() for consistency with row_to_payment() Additional fixes: - Added db import to src/api/mod.rs (needed for ready endpoint) - Added State import to src/api/mod.rs (needed for ready endpoint) - Added ConnectInfoLayer to the payments router for rate limiting middleware - Added ready function to src/api/mod.rs (was missing) - Updated tests/api_tests.rs to use correct Config fields Closes StellarGateLabs#47 StellarGateLabs#48 StellarGateLabs#43 StellarGateLabs#42 StellarGateLabs#41 StellarGateLabs#40 StellarGateLabs#39 StellarGateLabs#38 StellarGateLabs#45 StellarGateLabs#44 StellarGateLabs#46
|
I'd like to work on this. Approach:
Estimated effort: ~1-2 hours. PR incoming shortly. |
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.
I fixed 2 compilation issues in the StellarGate Rust project:
Config struct mismatch: Replaced usdc_issuer field with accepted_assets field in src/config.rs and updated src/horizon.rs to use the new field. Also added listener_mode and rate_limit_requests_per_sec fields.
Timestamp normalization: Fixed src/db.rs to normalize created_at in row_to_webhook_delivery() for RFC 3339 UTC consistency.
closes #24
closes #25