Feature/156 payment distributor tx tests - #246
Merged
Chucks1093 merged 2 commits intoAug 26, 2026
Merged
Conversation
The baseInvoice() fixture in the IPFS retry-exhaustion integration test predates the rejectionReason column added to the Invoice model, so it failed tsc's structural check on the `as Invoice` cast (TS2352) and blocked type-check (and therefore the pre-commit hook and CI) for the whole repo, not just this file. Adds rejectionReason: null to match the model's `string | null` field.
…ayoutsTx Closes StellarState#156 This issue's real dependency (StellarState#134, the full PaymentDistributorContractService) hasn't landed in this repo yet, so this adds a minimal service covering exactly what StellarState#156 asks for -- buildDistributePayoutsTx -- mirroring InvoiceEscrowContractService's constructor/dependency-injection shape so a fuller implementation can be layered on later without a breaking change to this surface. buildDistributePayoutsTx(invoiceId, recipients, platformFeeAccount, feeBps) encodes a single distribute_payouts contract call fanning a settlement's proceeds out to every recipient (sellers, investors) plus the platform fee account: invoiceId as a symbol, recipient addresses/amounts as parallel Vec<Address>/Vec<i128> arguments, the fee account as an Address, and feeBps as a u32. Validates recipients is non-empty and feeBps is an integer in [0, 10000] before encoding. Unit tests assert: the operation invokes exactly the configured PAYMENT_DISTRIBUTOR_CONTRACT_ID, the function name is "distribute_payouts", a multi-recipient fan-out serializes addresses and amounts in matching positional order, feeBps round-trips exactly across its valid range and is rejected outside [0, 10000], and invalid recipient/fee-account addresses throw. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
@Yormee-103 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! 🚀 |
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 #156
closes #157
closes #159
closes #154
Description
Closes #
Type of Change
Checklist
feat:,fix:,chore:, etc.) — enforced by CI.env, or credentials committed (seeCONTRIBUTING.md)Testing
How to Test
Test Coverage
Screenshots (if applicable)
Additional Notes
For Reviewers