Cross-Contract Composability Test Suite - #618
Open
vijay11149 wants to merge 1 commit into
Open
Conversation
Add integration tests verifying FinchippayContract composes correctly with real SAC tokens, multiple tokens in escrow, decimal edge cases, and an external contract caller (require_auth propagation). Wire the new suite into the contracts CI job. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #339
Summary
FinchippayContract had no tests exercising real Stellar Asset Contract (SAC) tokens or multi-contract call patterns. This PR adds
contracts/finchippay-contract/tests/integration_cross_contract.rs— a four-scenario integration suite that deploys real SAC tokens and mock external contracts against FinchippayContract — and wires the suite into CI.Changes
New:
contracts/finchippay-contract/tests/integration_cross_contract.rstest_sac_token_integrationtest_multi_token_escrowtest_decimal_edge_cases100; 18-decimal token escrows exactly1_000_000_000_000_000_000(==MAX_ESCROW_AMOUNT) — no overflow or precision loss.test_external_caller_auth_propagationsend_tip; fails withoutfromauth, succeeds with it, andrequire_authis recorded againstfrom.Supporting in-file test doubles:
MockToken— minimal SEP-41 token (transfer/balance/decimals/adminmint) with configurable decimals (the SAC is fixed at 7 decimals).ExternalCaller— minimal contract forwarding a tip into FinchippayContract to prove auth propagates across the call boundary.Changed:
.github/workflows/ci-contracts.ymlAdded
cargo test --test integration_cross_contractto thecontractsjob.Acceptance criteria
cargo test --test integration_cross_contractpasses all 4 scenarios.require_authpropagation works.contractsjob runs the new suite.Implementation notes
MockToken::transfertakesto: MuxedAddressto match SEP-41, sincetoken::Client::transferforwards a muxed address.mock_all_auths_allowing_non_root_auth()becausefrom.require_auth()happens inside Finchippay rather than the root invocation.soroban-sdkwithtestutils(already present) provides the SAC + auth test utilities.Testing