Skip to content

fix: resolve issues #863, #864, #865, #867#994

Merged
Wilfred007 merged 1 commit into
Gildado:mainfrom
Smartdevs17:main
Jun 29, 2026
Merged

fix: resolve issues #863, #864, #865, #867#994
Wilfred007 merged 1 commit into
Gildado:mainfrom
Smartdevs17:main

Conversation

@Smartdevs17

Copy link
Copy Markdown
Contributor

Summary

Fixes four issues across the bulk_payment and asset_path_payment contracts.

Issues Resolved

#863 — [asset_path_payment] actual_source_amount not validated as non-negative before storage

  • Added explicit actual_source_amount < 0 check with InvalidAmount error in complete_path_payment
  • Added unit test test_complete_path_payment_rejects_negative_source_amount

#864 — [asset_path_payment] token::Client::transfer failure during escrow release is unhandled

  • Documented the panic-on-failure behavior in the withdraw() doc comment
  • Added unit test test_withdraw_transfer_failure_preserves_contract_balance confirming contract state is consistent after a failed transfer

#865 — [asset_path_payment] No event emitted on successful withdraw()

  • Added WithdrawEvent contract event struct with asset, amount, to fields
  • Event is published at the end of a successful withdraw() call
  • Added unit test test_withdraw_emits_event asserting the event is published

#867 — [bulk_payment] execute_batch_partial() drops invalid entries without recording them as failed

  • Added FailureEntry and BatchPartialResult contract types
  • Changed execute_batch_partial return type from Result<u64, ContractError> to Result<BatchPartialResult, ContractError>
  • The returned failures list contains (index, amount, reason) for each skipped entry
  • Updated all existing tests to use the new return type
  • Added new test test_partial_batch_reports_failure_entries
  • Updated contracts/bulk_payment/README.md and docs/whitepaper.md to document the new return shape

Closes #863
Closes #864
Closes #865
Closes #867

- Gildado#863: Add non-negative validation for actual_source_amount in complete_path_payment
- Gildado#864: Document transfer failure behavior and add test for state consistency
- Gildado#865: Emit WithdrawEvent on successful withdraw() and add event test
- Gildado#867: Return BatchPartialResult with failure entries from execute_batch_partial; update docs and tests
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Smartdevs17 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

@Wilfred007 Wilfred007 merged commit 51eefa8 into Gildado:main Jun 29, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment