Skip to content

test(admin): add integration unit test preventing duplicate votes on multi-sig upgrade proposal - #845

Open
onajidavid87-web wants to merge 2 commits into
BCPathway:mainfrom
onajidavid87-web:Test-Double-vote-reverts
Open

test(admin): add integration unit test preventing duplicate votes on multi-sig upgrade proposal#845
onajidavid87-web wants to merge 2 commits into
BCPathway:mainfrom
onajidavid87-web:Test-Double-vote-reverts

Conversation

@onajidavid87-web

Copy link
Copy Markdown
Contributor

Closes #670

What does this PR do?

Adds a unit/integration test (test_double_vote_reverts) to verify that the multi-sig governance module in bc-forge-admin prevents duplicate votes on upgrade proposals.

When an authorized pool member attempts to approve a proposal they have already voted on, the contract must revert with AdminError::ProposalAlreadyApproved (Error code 10).

Added is_proposal_ready to AdminContract in

contracts/admin/tests/upgrade_e2e.rs
to allow proposal status checking during end-to-end integration testing.
Added test_double_vote_reverts:
Initialized an AdminContract instance with a multi-sig pool of 2 admins and a threshold of 2.
Admin 1 created a WASM upgrade proposal (automatically recorded as the first approval).
Step 1 (First Vote): Admin 2 approves the proposal (client.approve_proposal(&member, &proposal_id)). Asserted that is_proposal_ready returns true.
Step 2 (Second Vote Attempt): Admin 2 attempts to approve the proposal a second time via client.try_approve_proposal(&member, &proposal_id).
Step 3 (Revert Assertion): Asserted that the second attempt returns Err(Ok(soroban_sdk::Error::from_contract_error(AdminError::ProposalAlreadyApproved))).
🔍 Files Changed

contracts/admin/tests/upgrade_e2e.rs
: Added is_proposal_ready helper and test_double_vote_reverts test case.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • CI
  • Chore

Checklist

  • I ran pre-commit run --all-files locally and it passed
  • All CI jobs pass on this branch
  • I added or updated tests for new behaviour
  • I updated relevant docs / comments
  • No secrets or credentials are included
  • No breaking changes to public APIs (or I've documented them)

Breaking changes?

No

Related issues

Closes #670

…multi-sig upgrade proposals

This PR adds a unit/integration test (test_double_vote_reverts) to verify that the multi-sig governance module in bc-forge-admin prevents duplicate votes on upgrade proposals.

When an authorized pool member attempts to approve a proposal they have already voted on, the contract must revert with AdminError::ProposalAlreadyApproved (Error code 10).

Closes BCPathway#670
@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@onajidavid87-web 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

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.

[Testing] Test: Double vote reverts

1 participant