
davidherranandClaude Opus 4.7
1bde93921e
feat(governance): v0.0.28 origin-chain-governance pallet scaffold (Phase 5.1 Foundation Treasury CHN-4)
Phase 5.1 GOVERNANCE pallet scaffold canonical. Reemplaza placeholder
GovernanceConfig stub en existing origin-chain-governance crate con real FRAME
pallet. AI-Driven Human-Guarded canonical CHN-4 — 5 AI advisor agents ADVISE
only, humans-only vote canonical non-negotiable.
## Pallet surface canonical
- Pallet<T> + Config trait + RuntimeEvent
- Proposal struct (11 fields content-addressed via BLAKE2-256)
- ProposalStatus enum (Voting + Approved + Rejected + Withdrawn)
- Proposals<StorageMap<ProposalId, Proposal>> per-proposal O(1)
- Votes<StorageDoubleMap<ProposalId, AccountId, VoteStance>> double-vote prevention
- Events ProposalSubmitted + VoteCast + ProposalFinalized
- Errors 8 variants (ProposalNotFound + AlreadyVoted + VotingPeriodClosed/Open + StakeInsufficient + ProposalAlreadyFinalized + AdvisorMayNotVote + ProposalIdCollision)
- Scaffold dispatchables submit_proposal + cast_vote + finalize_proposal
- Helper derive_proposal_id via BLAKE2-256 hash (Inmutable #16 byte-determinism)
- sp_api::decl_runtime_apis! GovernanceApi declaration (query_proposal + query_vote)
## Types canonical updated
- origin-chain-types/src/governance.rs: added scale derives a ProposalId + VoteStance + Vote (Encode + Decode + DecodeWithMemTracking + MaxEncodedLen + TypeInfo) para FRAME-compatibility canonical
## Files
- EDIT: crates/origin-chain-governance/Cargo.toml (stub → FRAME pallet deps canonical)
- REPLACE: crates/origin-chain-governance/src/lib.rs (placeholder → ~360 LOC scaffold)
- EDIT: crates/origin-chain-types/src/governance.rs (scale derives canonical)
- EDIT: CHANGELOG.md (v0.0.28 entry)
## Verification
- cargo test -p origin-chain-governance — 5 tests verde, 0 failures
(pallet_compiles + derive_proposal_id deterministic + different + status variants + re-export)
🏛️ Phase 5.1 scaffold canonical. Wire pattern v0.0.29 next.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 12:41:27 -05:00
..
2026-05-25 06:43:14 -05:00
2026-05-19 22:08:49 -05:00
2026-05-19 22:08:49 -05:00
2026-05-24 22:59:57 -05:00
2026-05-25 12:41:27 -05:00
2026-05-25 06:45:10 -05:00
2026-05-24 22:40:04 -05:00
2026-05-25 06:45:10 -05:00
2026-05-25 12:41:27 -05:00
2026-05-19 22:08:49 -05:00