Repository navigation
fix(contracts): reject identical payer and beneficiary with InvalidParties error - #2073
Open
ranjan1969x wants to merge 1 commit into
Open
ranjan1969x wants to merge 1 commit into
ranjan1969x wants to merge 1 commit into
Conversation
…rties error Reject escrow creation when payer == beneficiary with Error::InvalidParties (DistinctCodes#22). Document id uniqueness and persistent retention rules in contracts/README.md, synchronize shared TypeScript error codes and client enum, and add test coverage for party validation and post-release id reuse. Closes DistinctCodes#2003
|
@ranjan1969x is attempting to deploy a commit to the naijabuz's projects Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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.
Summary
Enforces party distinction on escrow creation by rejecting
payer == beneficiarywith a newError::InvalidParties(#22), documents the single-use ID and persistent storage retention rules incontracts/README.md, and synchronizes TypeScript shared error codes and client enums.Changes
contracts/payment_escrow/src/lib.rs):InvalidParties = 22variant topub enum Error.if payer == beneficiary { return Err(Error::InvalidParties); }tocreate.contracts/README.md):InvalidParties(#22) to the Error Codes table.contracts/shared/error-codes.tswithInvalidParties = 22and name mapping.ContractErrorenum inbackend/src/payments/soroban/escrow-contract.client.ts.identical_payer_and_beneficiary_is_rejectedincontracts/payment_escrow/tests/edge_cases.rs.id_reuse_after_release_is_rejectedverifying that re-creating an escrow with a released ID is rejected withAlreadyExists.Verification
cargo test --workspace(31/31 contract tests passing, 100% green)npm test -- src/payments/soroban/(9 test suites passed, 78/78 tests green)Closes #2003