feat(governance): v0.0.33 Phase 5.2 COMPLETE — Council veto 2/3 threshold + GovernanceApi extension 🎉

Phase 5.2 TECHNICAL COUNCIL COMPLETE end-to-end canonical. veto_proposal
dispatchable + 2/3 ceiling threshold + 3 nuevos Runtime API methods
(is_council_member + current_council_size + veto_votes_count). CHN-4 5.2+5.5
materializado compile-detect.

## veto_proposal canonical 7-step CHN-4 5.5

1. ensure_signed
2. Validate council_member (NotCouncilMember)
3. Get proposal (must be Voting)
4. Validate council_size > 0 (InsufficientCouncilSize)
5. !VetoVotes::contains_key (AlreadyVetoed)
6. Insert vote + increment VetoCount
7. Check threshold: count >= council_veto_threshold(size) → Rejected + ProposalVetoed event

## Storage + events + errors canonical nuevo

- VetoVotes StorageDoubleMap presence-based + VetoCount cached u32
- Event::CouncilVetoVoteCast + ProposalVetoed
- Error::AlreadyVetoed + InsufficientCouncilSize

## Runtime API GovernanceApi extension canonical

- is_council_member(account) -> bool
- current_council_size() -> u32
- veto_votes_count(proposal_id) -> u32

## Verification

- cargo build --release 4.82s clean
- cargo test -p origin-chain-governance — 29 tests verde, 0 failures
  (10 lifecycle + 7 Council mgmt + 5 Council veto NEW + 5 standalone + 2 auto)
- cargo test --workspace — 189 tests verde, 0 failures

🎉 Phase 5.2 TECHNICAL COUNCIL COMPLETE canonical. Hijos de Arkhē somos.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
davidherranandClaude Opus 4.7 committed 2026-05-25 17:55:09 -05:00
1 parent afefcb2c04
commit b3fc5da6ca
5 files changed
+381 -10

No files matched your search

+14
View File
@@ -625,6 +625,20 @@ impl_runtime_apis! {
let runtime_voter = ChainAccountId::from(voter.0);
Governance::query_vote_of(proposal_id, &runtime_voter)
}
// Phase 5.2 v0.0.33 canonical Council query APIs
fn is_council_member(account: origin_chain_types::AccountId) -> bool {
let runtime_account = ChainAccountId::from(account.0);
Governance::is_council_member(&runtime_account)
}
fn current_council_size() -> u32 {
Governance::current_council_size()
}
fn veto_votes_count(proposal_id: origin_chain_types::ProposalId) -> u32 {
Governance::veto_count_of(proposal_id)
}
}
}