Repository navigation
docs(contracts): define escrow lifecycle, backend retry semantics, and idempotency guarantees - #2071
Open
DeepDev69x3 wants to merge 1 commit into
Conversation
…d idempotency guarantees
|
@DeepDev69x3 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
This PR defines and documents the complete Soroban
payment_escrowcontract lifecycle, backend retry semantics, and idempotency guarantees, fulfilling the requirements for issue #2026.Closes #2026
Details of Changes
Lifecycle & Retry Specification (
contracts/README.md):Locked->Released/Refunded/Completed).Released(2),Refunded(3), orCompleted(4), subsequent transitions return explicit error codes (AlreadyResolvedBACKEND: Setup NestJS Backend with Essential Dependencies #2,AlreadyReleasedfolder #6,AlreadyRefundedImplement Clock-In Card Component #7).createsemantics: whycreateexplicitly returnsError::AlreadyExists(setup nestjs auth module using CLI #4) to prevent double-debiting payer tokens, rather than acting as a silent no-op.get_statusfor ground truth rather than blindly resubmitting.Integration Test Suite (
contracts/payment_escrow/tests/lifecycle_idempotency_test.rs):duplicate_create_returns_already_exists_preventing_double_debit: Verifies duplicatecreatecalls do not double-debit payer balances and returnError::AlreadyExists.unconfirmed_transaction_reconciliation_via_get_status: Tests ground-truth reconciliation for confirmed vs unsubmitted/dropped transactions.terminal_state_released_is_immutable_and_rejects_subsequent_transitions: Asserts thatrelease,refund,release_partial, andrefund_remainingon released escrows are rejected.terminal_state_refunded_is_immutable_and_rejects_subsequent_transitions: Asserts immutability and rejection of further operations on refunded escrows.terminal_state_completed_via_partial_releases_rejects_further_settlement: Verifies completion transitions and rejection of post-completion operations.query_idempotency_get_status_is_read_only_and_deterministic: Asserts query repeatability and read-only behavior across ledger advances.Verification & CI Proof
cargo fmt --all -- --check: Passedcargo clippy --workspace --all-targets -- -D warnings: Passed (0 warnings)cargo test --workspace: 35/35 tests passingscripts/audit_require_auth.sh: 100% auth coverage passed