Skip to content

Contracts - Add settle_commitment alias matching backend method name for compatibility #478

@1nonlypiece

Description

@1nonlypiece

Contracts - Add settle_commitment alias matching backend method name for compatibility

Description

The backend src/lib/backend/services/contracts.ts invokes settle_commitment, but the contract exposes release. Add a settle_commitment(commitment_id, caller) entrypoint in contracts/escrow/src/lib.rs that performs the matured release, aligning the on-chain ABI with the backend's expectations.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Add settle_commitment delegating to the release logic
  • Return a settlement result shape the backend can parse
  • Keep release for permissionless matured settlement
  • Add tests in contracts/escrow/src/test.rs for the alias

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feature/settle-commitment-alias
  • Implement changes
    • Add settle_commitment in contracts/escrow/src/lib.rs
    • Add tests in contracts/escrow/src/test.rs
    • Document the ABI alignment in contracts/README.md
    • Add cross-reference comments to the backend method
  • Test and commit
    • Run tests, cover edge cases
    • Include test output and notes

Example commit message

feat: add settle_commitment entrypoint matching backend ABI

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions