Skip to content

Add comprehensive tests, improve API docs, and reconcile types - #200

Merged
meshackyaro merged 2 commits into
trustflow-protocol:mainfrom
girly-coder01:feature/comprehensive-tests-and-type-reconciliation
Aug 31, 2026
Merged

Add comprehensive tests, improve API docs, and reconcile types#200
meshackyaro merged 2 commits into
trustflow-protocol:mainfrom
girly-coder01:feature/comprehensive-tests-and-type-reconciliation

Conversation

@girly-coder01

@girly-coder01 girly-coder01 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR addresses four related issues involving tests, documentation, and type safety:

Test plan

  • Run npm test to verify all test suites pass
  • Verify that SimpleCache tests exercise TTL expiry with fake timers
  • Verify that schema tests validate network enum changes
  • Review updated API.md for completeness and accuracy

…rustflow-protocol#118: Add comprehensive tests and improve documentation

## Changes

### trustflow-protocol#116: Expand SimpleCache unit tests
- Added comprehensive tests covering TTL expiry logic with fake timers
- Tests for default vs custom TTL behavior
- Tests for size(), delete(), clear() methods
- Edge case tests including expiry at boundary and re-setting expired keys
- Generic type handling tests
- LazyEviction on get tests

### trustflow-protocol#117: Zod schemas already have comprehensive unit tests
- Confirmed tests/schemas.test.ts covers all 8 schemas with edge cases
- Tests validate address formats, positive amounts, network enums, URL validation

### trustflow-protocol#113: Expand docs/API.md to document previously undocumented modules
- Added comprehensive TrustFlowClient documentation with constructor, methods, and examples
- Added MultiSigEscrowClient documentation with flow, methods, and real-world examples
- Added wallet module documentation (connectWallet, getFreighter, getAlbedo, isFreighterInstalled)
- Added event parsing utilities documentation (parseEvent, parseEvents, isTrustFlowEvent)
- Improved Zod schemas documentation section

### trustflow-protocol#118: Resolve ClientConfig/Network type collision between schemas.ts and types.ts
- Updated ClientConfigSchema in schemas.ts to match actual SDK usage:
  - Replaced 'horizonUrl' with 'apiBaseUrl' and 'apiKey' fields
  - Now matches the ClientConfig interface in types.ts
- Updated NetworkSchema to remove 'FUTURENET' (not actually supported by SDK):
  - Only supports 'MAINNET' and 'TESTNET' as per types.ts
  - Aligns with HORIZON_URLS and SOROBAN_RPC_URLS in constants.ts
- Updated schema tests to reflect the schema changes
- Schemas and types are now compatible and ready to be exported alongside each other
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@girly-coder01 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

@meshackyaro
meshackyaro merged commit 16492a6 into trustflow-protocol:main Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants