Fix/testing and features 1147 1067 1151 1141#1259
Merged
Olowodarey merged 6 commits intoJun 29, 2026
Merged
Conversation
…null handling Tests cover: - No season exists in database - Season window hasn't started yet - Season has already ended - Multiple overlapping active seasons returns latest Closes Arena1X#1147 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Tests verify: - Normal responses wrapped in success envelope - StreamableFile instances not wrapped - 204 and 304 status codes bypass wrapping - Timestamp field added to wrapped responses - Array and null responses handled correctly Closes Arena1X#1141 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Implement proper socket disconnection when rate limit is exceeded. Add tests to verify: - Socket remains connected after 60 messages - Socket disconnects on 61st message - Rate limiting is enforced per-socket - Rate limit counter resets after time window expires Closes Arena1X#1151 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Allows market creators to extend the end_time of a market before it closes. Implementation: - Add extend_market_end_time function in market.rs - Wire into lib.rs contract implementation - Add MarketAlreadyClosed error type - Automatically adjust resolution_time if needed to maintain invariant Validation: - Only creator can call - Only before market end_time passes - New end_time must be strictly later than current - Market cannot be resolved, cancelled, or closed - Resolution time >= end_time invariant maintained Tests cover: - Successful extension - Resolution time adjustment when needed - Unauthorized access prevention - All market state restrictions - Time range validation Closes Arena1X#1067 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Fixes: - Response interceptor: simplify 204/304 status passthrough assertions - Events gateway: add disconnect mock to socket factory - Events gateway: fix timer test to properly verify rate limit cleanup All tests now passing. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Changes: - Assign MarketAlreadyClosed error code 25 (was conflicting with PredictionNotFound) - Remove unnecessary `mut` keywords from test variables - Remove unused variable warnings All 58 market tests pass successfully. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@tech-adrian 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.
Pull Request: Testing & Features Implementation
Summary
This PR addresses four key issues across the backend and smart contract layers:
SeasonsService.findActivereturns null when no season window matches now #1147: Comprehensive testing for SeasonsService.findActive null handlingResponseInterceptorwraps all non-empty responses in the success envelope #1141: New test suite for ResponseInterceptor wrapping behaviorEventsGatewayrate-limiter disconnects socket after exceedingRATE_LIMIT#1151: Rate-limiter disconnect implementation and testing for EventsGatewayend_timebefore market closes #1067: Market end_time extension feature for contractChanges
Backend Tests (NestJS)
#1147: SeasonsService.findActive Tests
#1141: ResponseInterceptor Tests
#1151: EventsGateway Rate-Limiter
Smart Contract (Soroban/Rust)
#1067: Market End-Time Extension Feature
extend_market_end_timefunction to market.rsMarketAlreadyClosederror type (code 25)Testing
Backend
All 40 tests passing
Smart Contract
All tests passing, no warnings
Files Changed
Backend:
src/seasons/seasons.service.spec.ts- Enhanced findActive testssrc/common/interceptors/response.interceptor.spec.ts- New test suitesrc/websocket/events.gateway.ts- Added socket disconnectsrc/websocket/events.gateway.spec.ts- Enhanced rate-limiter testsSmart Contract:
src/market.rs- Added extend_market_end_time functionsrc/lib.rs- Wired new function into contractsrc/errors.rs- Added MarketAlreadyClosed error typetests/market_tests.rs- Added 8 integration testsCloses
SeasonsService.findActivereturns null when no season window matches now #1147ResponseInterceptorwraps all non-empty responses in the success envelope #1141EventsGatewayrate-limiter disconnects socket after exceedingRATE_LIMIT#1151end_timebefore market closes #1067