Skip to content

[CT-17] Write integration tests for the full shipment and escrow lifecycle #925

@mftee

Description

@mftee

Problem

The shipment and escrow contracts are each tested in isolation. There are no integration tests verifying that the full end-to-end flow — creating a shipment, funding escrow, accepting, going in-transit, delivering, and releasing funds — works correctly when both contracts interact.

Proposed Solution

Write integration tests inside contracts/package/tests/integration/ that deploy both contracts in the same Soroban test environment and exercise complete lifecycle flows.

Note: All work must be done inside the contracts/package/ directory. Do not modify any existing contract files outside this folder.

Acceptance Criteria

  • Test flow 1 — Happy path: create shipment → fund escrow → accept → in-transit → deliver → release funds → verify carrier token balance increased
  • Test flow 2 — Dispute path: create shipment → fund escrow → deliver → open dispute → admin resolves with refund → verify shipper token balance restored
  • Test flow 3 — Cancellation path: create shipment → fund escrow → cancel → refund → verify shipper token balance restored
  • Each test deploys fresh contract instances and a mock SEP-41 token
  • All three flows run successfully via cargo test from within contracts/package/tests/integration/

Metadata

Metadata

Assignees

Labels

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