-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
difficulty: mediumStandard features across multiple codebase sectionsStandard features across multiple codebase sections
Description
Context
The SDK package (packages/sdk/) contains PaymentStreamClient and DistributorClient — the TypeScript wrappers around the generated Soroban contract bindings. These clients are the critical interface between the frontend and the smart contracts, yet they have zero test files. If a contract ABI changes or a method signature is updated, there is no automated way to catch regressions before they hit the UI.
What Success Looks Like
- Test files exist for both
PaymentStreamClientandDistributorClient - Tests cover: method signatures, parameter validation, error handling, and return type shapes
- Contract calls are mocked at the RPC level (no live network dependency)
- Tests run with Vitest and are integrated into the project's test pipeline
- Coverage includes:
createStream,deposit,withdraw,cancelStream,pauseStream,resumeStream,setDelegate,revokeDelegatefor streams;distributeEqual,distributeWeightedfor distributor
Implementation Guidance
packages/sdk/src/PaymentStreamClient.ts— stream client with ~15 public methodspackages/sdk/src/DistributorClient.ts— distributor clientpackages/sdk/src/generated/— generated bindings that the clients wrap- Follow the testing patterns from
apps/web/src/services/stellar.service.test.tsfor mocking RPC calls - Mock
SorobanRpc.ServerandContractat the module level - Test both success and error paths (network failure, invalid params, contract revert)
- The SDK package may need its own
vitest.config.tsif it doesn't have one
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
difficulty: mediumStandard features across multiple codebase sectionsStandard features across multiple codebase sections