feat(governance): activate OpenGov production periods and add Welati tracks

Upgrade all 15 OpenGov track periods from Westend test values (minutes)
to Polkadot production values (hours/days). Add 3 new Welati governance
tracks (welati_election, welati_admin, citizenship_admin) with origins
and XCM routing for RC → People Chain governance via OpenGov referenda.

Bump spec_version: 1_020_007 → 1_020_008
This commit is contained in:
2026-02-18 23:36:31 +03:00
parent d6f180621e
commit ce79d33f0d
6 changed files with 179 additions and 64 deletions
@@ -115,6 +115,34 @@ pub type FungibleTransactor = FungibleAdapter<
(),
>;
/// Converts relay chain Welati governance Plurality origins to Root.
///
/// When an RC OpenGov referendum passes on a Welati track (40/41/42), the enacted call sends
/// an XCM Transact to this People Chain. The Welati origins are encoded as Plurality
/// (BodyId::Index(40/41/42)) from the relay parent. This converter maps them to Root so that
/// the welati pallet's `ensure_root` calls succeed.
///
/// Recognized Welati body IDs:
/// - Index(40): WelatiElection — initiate/finalize elections
/// - Index(41): WelatiAdmin — tiki grants, official appointments
/// - Index(42): CitizenshipAdmin — citizenship revocation, trust score updates
pub struct RelayWelatiPluralityAsRoot;
impl xcm_executor::traits::ConvertOrigin<RuntimeOrigin> for RelayWelatiPluralityAsRoot {
fn convert_origin(
origin: impl Into<Location>,
kind: OriginKind,
) -> Result<RuntimeOrigin, Location> {
let origin = origin.into();
match (kind, origin.unpack()) {
(
OriginKind::Superuser,
(1, [Plurality { id: BodyId::Index(40 | 41 | 42), .. }]),
) => Ok(RuntimeOrigin::root()),
_ => Err(origin),
}
}
}
/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance,
/// ready for dispatching a transaction with XCM's `Transact`. There is an `OriginKind` that can
/// bias the kind of local `Origin` it will become.
@@ -132,6 +160,8 @@ pub type XcmOriginToTransactDispatchOrigin = (
// Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a
// transaction from the Root origin.
ParentAsSuperuser<RuntimeOrigin>,
// Welati governance origins from relay chain — converts Plurality(Index(40/41/42)) to Root.
RelayWelatiPluralityAsRoot,
// Native signed account converter; this just converts an `AccountId32` origin into a normal
// `RuntimeOrigin::Signed` origin of the same 32-byte value.
SignedAccountId32AsNative<RelayNetwork, RuntimeOrigin>,