Skip to content

Fix/issues 1119 1120 1121 1122 - #1193

Open
usman222nuhu wants to merge 5 commits into
StellerCraft:mainfrom
usman222nuhu:fix/issues-1119-1120-1121-1122
Open

Fix/issues 1119 1120 1121 1122#1193
usman222nuhu wants to merge 5 commits into
StellerCraft:mainfrom
usman222nuhu:fix/issues-1119-1120-1121-1122

Conversation

@usman222nuhu

Copy link
Copy Markdown

Summary

Consolidate circuit-breaker implementations, improve issuer verification caching, and add comprehensive unit test coverage.

Changes

Test Results

  • Storage Namespace: 27 tests ✓
  • Mock Utilities: 39 tests ✓
  • Trustline Validation: 32 tests ✓
  • Horizon Client: 18 tests ✓
  • Backend Circuit Breaker: 18 tests ✓

Closes #1119
Closes #1120
Closes #1121
Closes #1122

…nto shared package

- Create unified CircuitBreaker in packages/stellar/src/circuit-breaker.ts
- Support both functional wrapper API (call()) and manual state API (isOpen(), recordSuccess(), recordFailure())
- Update backend circuit-breaker to re-export from shared implementation
- Update horizon-client to use shared CircuitBreaker with proper configuration mapping
- Ensures all circuit breaker instances share same behavior and bug fixes
… verification

- Add shorter 1-minute TTL for 'not found' results vs 5-minute TTL for valid results
- Minimizes false negatives from eventual consistency delays when issuer created/deployed
- Add 'forceRefresh' parameter to skip cache reads while still writing results back
- Implement getCacheTtlForResult() helper for differentiated TTL strategy
…space.ts

- Comprehensive round-trip testing for namespaceKey() and stripNamespace()
- Test zero, single, and multiple collision detection scenarios
- Verify assertNoStorageKeyCollisions() throws with correct error details
- Test edge cases: empty keys, multiple colons, duplicate entries, durability fields
- Add StorageKeyCollisionError validation tests
…mock utilities

- Add shape validation for all mock factory functions (account, transaction, ledger, asset, orderbook)
- Test structure and required fields for each mock type
- Validate default behaviors and override capabilities
- Test cross-factory consistency (date formats, object creation)
- Comprehensive coverage of all exported mock factories
…d circuit-breaker

- Export circuit-breaker and horizon-client from packages/stellar/src/index.ts
- Update backend circuit-breaker with full implementation (not re-export) for test compatibility
- Update horizon-client tests to use unified CircuitBreaker API with config objects
- Fix state constant names from lowercase to uppercase (CLOSED, OPEN, HALF_OPEN)
- All existing tests now pass with consolidated implementation
@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@usman222nuhu 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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment