Skip to content

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

Merged
Josue19-08 merged 4 commits into
TrustUp-app:mainfrom
diegoucampos-tech:feat/sc-83-integration-tests
Jul 21, 2026
Merged

feat: implement integration test suite (SC-83)#87
Josue19-08 merged 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

@Josue19-08 Josue19-08 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integration test suite covers the three core scenarios from #83 (BNPL lifecycle, loan default, unauthorized access). CI passes on both Build and Test jobs. The runtime panics fixed during setup (Reputation admin init, set_creditline authorization, exposure limit amounts, repay_loan balance logic) are documented and reflect real contract constraints. Committing Cargo.lock is justified for reproducible CI builds. The reputation-contract unit test fix (filtering SCORECHGD events by reason) is correct. Ready to merge.

@Josue19-08
Josue19-08 merged commit 2dec986 into TrustUp-app:main Jul 21, 2026
2 checks passed
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

2 participants