Problem
The escrow contract in contracts/escrow/ handles all payment operations on the platform — fund holding, release, refund, and dispute resolution — but has minimal test coverage. Bugs in financial logic go undetected until real funds are lost.
Proposed Solution
Write a comprehensive test suite for the escrow contract inside contracts/package/tests/escrow/ using the Soroban SDK test harness with mock token contracts.
Note: All work must be done inside the contracts/package/ directory. Do not modify any existing contract files outside this folder.
Acceptance Criteria
Problem
The escrow contract in
contracts/escrow/handles all payment operations on the platform — fund holding, release, refund, and dispute resolution — but has minimal test coverage. Bugs in financial logic go undetected until real funds are lost.Proposed Solution
Write a comprehensive test suite for the escrow contract inside
contracts/package/tests/escrow/using the Soroban SDK test harness with mock token contracts.Acceptance Criteria
fund_escrow: success path, double-funding the same escrow returnsAlreadyFundedrelease_funds: shipper can release, non-shipper caller returnsUnauthorizedrefund: only callable when shipment is cancelled, returnsInvalidStateotherwiseopen_dispute: shipper and carrier can open, third party returnsUnauthorizedadmin_resolve: admin can release or refund, non-admin returnsUnauthorizedEnv::default()test environment and a mock SEP-41 token contractcargo testruns all tests successfully fromcontracts/package/tests/escrow/