Skip to content

feat: add multi-token pool support integration test #417

@sanmipaul

Description

@sanmipaul

Summary

`contracts/tests/integration_tests.rs` has no test covering multi-token pool operations. The pool supports multiple tokens (USDC, XLM, etc.) but all existing integration tests use a single token. Edge cases unique to multi-token pools are completely untested.

Missing Test Cases

  1. Deposit USDC and XLM in the same pool, verify balances are tracked separately
  2. Fund one invoice in USDC and another in XLM, verify each uses the correct token
  3. Repay USDC invoice with USDC (correct) vs. XLM (should fail)
  4. Yield accrual is calculated per-token, not pooled across tokens
  5. Withdraw USDC does not affect XLM balance and vice versa
  6. Remove one token while other remains active — verify isolation

Implementation Notes

  • Use Soroban test environment's `register_stellar_asset_contract()` to create multiple mock tokens
  • The test should cover at least two tokens simultaneously
  • Use the existing `integration_tests.rs` helper functions for setup

Acceptance Criteria

  • Test `test_multi_token_deposit_isolation` created and passing
  • Test `test_multi_token_fund_and_repay` created and passing
  • Test `test_cross_token_repay_rejected` created and passing
  • All new tests run in CI without additional configuration

References

  • `contracts/tests/integration_tests.rs`
  • `contracts/pool/src/lib.rs` — multi-token support

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programsmart-contractSoroban/Rust contract worktestingTest coverage and quality

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions