fix(#868,#869,#883,#866): overflow guard, rollback typo, concurrency invariant, self-payment check#998
Open
devonahi wants to merge 1 commit into
Open
fix(#868,#869,#883,#866): overflow guard, rollback typo, concurrency invariant, self-payment check#998devonahi wants to merge 1 commit into
devonahi wants to merge 1 commit into
Conversation
… rollback typo, concurrency invariant, self-payment guard - Gildado#868: Add overflow test for execute_batch_partial (checked_add already present) - Gildado#869: Fix misspelled event topic 'rollbck' → 'rollback' in bulk_payment - Gildado#883: Add invariant re-deriving remaining balance from milestone state before transfer in release_milestone(); add concurrency model documentation - Gildado#866: Reject self-payments (from == to) in asset_path_payment with clear error
|
@devonahi 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.
Summary
Closes #868
bulk_payment: Verifiedexecute_batch_partialalready useschecked_addfor i128 accumulation; added test asserting overflow returnsAmountOverflow(error #7) instead of panicking or wrapping.Closes #869
bulk_payment: Fixed misspelled event topic"rollbck"→"rollback"in bothexecute_batch_partialandexecute_partial_with_refund. Updated all test assertions matching on the symbol.Closes #883
milestone_escrow: Added explicit concurrency model doc comment explaining Soroban's single-threaded execution. Added invariant check inrelease_milestone()that re-derives remaining balance fromtotal_amount - released_amountbefore transfer, preventing double-spend under future cross-contract changes. Added sequential release test verifying balances never go negative.Closes #866
asset_path_payment: AddedSelfPaymenterror variant and early rejection whenfrom == toininitiate_path_payment. Added unit test asserting the rejection.Files Changed
contracts/bulk_payment/src/lib.rs— "rollbck" → "rollback" (2 sites)contracts/bulk_payment/src/test.rs— updated test names/assertions + overflow testcontracts/milestone_escrow/src/lib.rs— concurrency docs + invariant checkcontracts/milestone_escrow/src/test.rs— sequential release testcontracts/asset_path_payment/src/lib.rs—SelfPaymenterror +from == toguardcontracts/asset_path_payment/src/test.rs— self-payment rejection test