Skip to content

fix: Add support for multi-token batch routing in a single transaction - #574

Open
Chummy-debug wants to merge 1 commit into
Abdulazeem-code:mainfrom
Chummy-debug:solver/issue-513-27-a0
Open

fix: Add support for multi-token batch routing in a single transaction#574
Chummy-debug wants to merge 1 commit into
Abdulazeem-code:mainfrom
Chummy-debug:solver/issue-513-27-a0

Conversation

@Chummy-debug

Copy link
Copy Markdown

Summary

Implemented support for multi-token batch routing in a single transaction for issue #513.

The Payment struct already explicitly included a token_address field per payment, and route_payments already iterated each payment and dispatched to process_single_payment using each payment's own token address — so the core routing logic already handled mixed tokens correctly.

The missing piece was test coverage. I added test_route_payments_multi_token_batch in payment_router/src/lib.rs which:

  • Creates two distinct tokens (USDC-like and EURC-like)
  • Routes a batch of two payments with different tokens and different recipients in a single route_payments call
  • Verifies each token's sender balance, recipient balance, and treasury fee are correct (100 bps fee: 20 for the 2000 USDC payment, 10 for the 1000 EURC payment)
  • Verifies the sender's cumulative volume aggregates across both tokens (3000)

All three acceptance criteria are satisfied: (1) Payment supports individual token addresses, (2) batch routing handles mixed tokens, (3) tests verify multi-token routing succeeds.

Changed files

  • payment_router/src/lib.rs

Test plan

Run the contract test suite:

  • cargo test -p payment_router (or cargo test in the payment_router directory)

This will run the new test_route_payments_multi_token_batch test along with all existing tests. The test verifies multi-token batch routing succeeds with correct per-token fee deductions, recipient credits, and aggregated sender volume.

This PR was created as a draft by the issue solver bot. It will remain a
draft until repository CI passes.

Closes #513

@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

@issue-solver-bot is attempting to deploy a commit to the Abdulazeem's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@Chummy-debug 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

@Chummy-debug
Chummy-debug marked this pull request as ready for review August 26, 2026 00:34
@Abdulazeem-code

Copy link
Copy Markdown
Owner

KINDLY RESOLVE CONFLICTS

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.

Add support for multi-token batch routing in a single transaction

3 participants