Skip to content

feat(invoice-escrow): add multi-token escrow payment support - #264

Open
Promzy204-bad wants to merge 1 commit into
StellarState:devfrom
Promzy204-bad:feature/multi-token-escrow-payment
Open

feat(invoice-escrow): add multi-token escrow payment support#264
Promzy204-bad wants to merge 1 commit into
StellarState:devfrom
Promzy204-bad:feature/multi-token-escrow-payment

Conversation

@Promzy204-bad

Copy link
Copy Markdown
  • Fix duplicate discriminant 15 in errors.rs (Paused vs InvalidPayer); renumber InvalidPayer=16, InvalidDueDate=17, add TokenNotAccepted=18
  • Add accepted_tokens Vec field to EscrowData in types.rs
  • Update create_escrow to accept accepted_tokens param; validate list is non-empty and payment_token is a member; enforce ensure_not_paused
  • Update fund_escrow to accept funding_token param; validate token against accepted_tokens; lock chosen token on first fund contribution
  • record_payment and refund always use the locked-in data.token
  • Fix Option IntoVal issues in invoke_contract calls (use .to_val())
  • Emit accepted_tokens (as Val) in escrow_created event
  • Update all existing tests to pass new function signatures
  • Add 7 new multi-token unit tests covering: create with multi-token list, payment_token not in accepted list, empty accepted list, fund with accepted token, fund with rejected token, payment uses locked funding token, single-token backwards compat, accepted_tokens in created event

All 67 tests pass.

Description

Closes #

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🎨 UI/UX improvement
  • ♻️ Code refactoring
  • ✅ Test addition or update
  • 🔧 Configuration change

Checklist

  • My code follows the code style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Testing

How to Test

  1. Step one
  2. Step two
  3. Step three

Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • E2E tests added/updated (if applicable)
  • Manual testing completed

Screenshots (if applicable)

Additional Notes

For Reviewers

- Fix duplicate discriminant 15 in errors.rs (Paused vs InvalidPayer);
  renumber InvalidPayer=16, InvalidDueDate=17, add TokenNotAccepted=18
- Add accepted_tokens Vec<Address> field to EscrowData in types.rs
- Update create_escrow to accept accepted_tokens param; validate list is
  non-empty and payment_token is a member; enforce ensure_not_paused
- Update fund_escrow to accept funding_token param; validate token against
  accepted_tokens; lock chosen token on first fund contribution
- record_payment and refund always use the locked-in data.token
- Fix Option<Address> IntoVal issues in invoke_contract calls (use .to_val())
- Emit accepted_tokens (as Val) in escrow_created event
- Update all existing tests to pass new function signatures
- Add 7 new multi-token unit tests covering: create with multi-token list,
  payment_token not in accepted list, empty accepted list, fund with accepted
  token, fund with rejected token, payment uses locked funding token,
  single-token backwards compat, accepted_tokens in created event

All 67 tests pass.
@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@Promzy204-bad Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@chizzy192
chizzy192 changed the base branch from main to dev July 29, 2026 15:54
@chizzy192 chizzy192 closed this Jul 29, 2026
@chizzy192 chizzy192 reopened this Jul 29, 2026
@chizzy192

Copy link
Copy Markdown
Contributor

Hi @Promzy204-bad, please rebase on dev to resolve struct definition conflicts in contracts/invoice-escrow/src/types.rs where multi-token data structures overlap with recent storage refactors.

@chizzy192 chizzy192 closed this Jul 30, 2026
@chizzy192 chizzy192 reopened this Jul 30, 2026
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.

[CONTRACTS] Invoice Escrow: Add Multi-Token Escrow Payment Support

2 participants