Skip to content

feat(settlement-workflow): implement on-chain compliance-gated execution workflow - #335

Merged
misrasamuelisiguzor-oss merged 2 commits into
WHEELBACK:mainfrom
Markadrian6399:feature/273-settlement-workflow-contract
Jul 27, 2026
Merged

feat(settlement-workflow): implement on-chain compliance-gated execution workflow#335
misrasamuelisiguzor-oss merged 2 commits into
WHEELBACK:mainfrom
Markadrian6399:feature/273-settlement-workflow-contract

Conversation

@Markadrian6399

@Markadrian6399 Markadrian6399 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a new contracts/settlement-workflow/ crate implementing the SettlementWorkflow role documented in ARCHITECTURE.md's sequence diagram: gates Treasury::execute_settlement behind Compliance::is_allowed, since Treasury does not consult compliance itself.
  • Consumes compliance-client for the compliance check and treasury's generated client directly for execution, per the issue's suggested execution.
  • Adds contracts/settlement-workflow/tests/settlement_workflow_test.rs covering: execution blocked when compliance returns false (WorkflowError::ComplianceFailed, no token transfer), and the successful path executing the treasury settlement and transferring tokens to the merchant.
  • Registers the new crate in the workspace Cargo.toml.

Closes #274

Validation performed

  • cargo fmt -p comebackhere-settlement-workflow passes.
  • cargo test --all could not be run: the pre-existing comebackhere-treasury/comebackhere-invoice crates fail to compile in this environment with TreasuryContractArgs/TreasuryContractClient not found errors. This reproduces identically on a clean main checkout with zero changes applied (unrelated to this change, not addressed here per scope). The new contract's logic mirrors the already-tested execute_with_compliance reference implementation in contracts/treasury/tests/compliance_gate_integration_test.rs, calling the same client methods with the same signatures.

@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

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

@misrasamuelisiguzor-oss
misrasamuelisiguzor-oss merged commit 67fa737 into WHEELBACK:main Jul 27, 2026
1 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#83: Full end-to-end integration test — invoice → proposal → compliance → execution → escrow release

3 participants