Skip to content

feat: implement integration test suite (SC-83)#87

Open
diegoucampos-tech wants to merge 4 commits into
TrustUp-app:mainfrom
diegoucampos-tech:feat/sc-83-integration-tests
Open

feat: implement integration test suite (SC-83)#87
diegoucampos-tech wants to merge 4 commits into
TrustUp-app:mainfrom
diegoucampos-tech:feat/sc-83-integration-tests

Conversation

@diegoucampos-tech

@diegoucampos-tech diegoucampos-tech commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Description

Implementation of the cross-contract integration test suite for the TrustUp-Contracts project as described in SC-83. This includes testing the core BNPL lifecycle, default scenarios, unauthorized access handling, and fixing various runtime panics discovered during testing.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Changes Made

  • Added a new tests/integration package to the workspace.
  • Implemented TestEnv setup for initializing and linking CreditLine, LiquidityPool, MerchantRegistry, and Reputation contracts using soroban-sdk testutils.
  • Added integration tests for:
    • Full BNPL lifecycle (test_full_bnpl_lifecycle).
    • Default loan scenarios (test_loan_default).
    • Unauthorized access (test_unauthorized_access).
  • Fixed runtime panics in tests:
    • Initialized Reputation contract admin during setup.
    • Authorized CreditLine in LiquidityPool via set_creditline during setup.
    • Adjusted loan requested amounts to prevent ExposureLimitExceeded panics.
    • Fixed repay_loan amount logic in tests to accurately reflect remaining balance, preventing InvalidRepaymentAmount errors.
  • Fixed reputation-contract unit tests by correctly filtering SCORECHGD events by reason before asserting values.
  • Removed Cargo.lock from .gitignore and committed it to ensure reproducible builds in CI and prevent soroban-env-host trait bound compilation errors.

Testing

  • Tests pass locally
  • New tests added (if applicable)

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Comments added for complex code
  • Documentation updated
  • No new warnings generated

Closes #83

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add cross-contract integration test suite

1 participant