Skip to content

[Contract] — Test: cancel_proposal on an already-executed proposal returns an error #1064

Description

@Olowodarey

Background

governance::cancel_proposal should not allow cancelling a proposal that has
already been executed (proposal.executed == true). The governance tests do not
cover this rejection path.

Goal

Add a test in tests/governance_tests.rs.

Tasks

  1. Create and execute a proposal (following the pattern in
  2. Attempt cancel_proposal on the executed proposal.
  3. Assert an error is returned (check src/governance.rs for the exact error —
  4. Also test cancel_proposal on a pending proposal; assert success

Acceptance Criteria

  • Executed proposals cannot be cancelled.
  • Pending proposals can be cancelled.

Files

contracts/open-market/tests/governance_tests.rs.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions