From 172b04e4d42ddd7c0c391a741e407ba11ff5547e Mon Sep 17 00:00:00 2001 From: Kurdistan Tech Ministry Date: Tue, 10 Feb 2026 07:01:36 +0300 Subject: [PATCH] fix: workflow failures - cargo fmt, taplo fmt, and StakingConfig - Update taplo.toml exclude patterns to use glob patterns for zombienet files - Add StakingConfig to genesis_config_presets for proper era initialization - Fix cargo fmt issues in identity-kyc pallet and pezkuwichain runtime - Set num_cores to 2 for system teyrchains (Asset Hub + People Chain) --- .config/taplo.toml | 10 +++--- Cargo.lock | 1 + Cargo.toml | 8 ++--- .../identity-kyc/src/benchmarking.rs | 2 +- .../pezpallets/identity-kyc/src/lib.rs | 11 +++++-- .../src/genesis_config_presets.rs | 33 +++++++++++++++---- pezkuwi/runtime/pezkuwichain/src/lib.rs | 4 +-- 7 files changed, 45 insertions(+), 24 deletions(-) diff --git a/.config/taplo.toml b/.config/taplo.toml index eaf586b9..c71dd026 100644 --- a/.config/taplo.toml +++ b/.config/taplo.toml @@ -2,12 +2,10 @@ # ignore zombienet as they do some deliberate custom toml stuff exclude = [ - "bizinikiwi/client/transaction-pool/tests/zombienet/**", - "bizinikiwi/zombienet/**", - "pezbridges/testing/**", - "pezcumulus/zombienet/**", - "pezkuwi/node/malus/integrationtests/**", - "pezkuwi/zombienet_tests/**", + "**/integrationtests/**", + "**/testing/**", + "**/zombienet/**", + "**/zombienet_tests/**", "target/**", ] diff --git a/Cargo.lock b/Cargo.lock index 066d9988..ee9b4d66 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14932,6 +14932,7 @@ dependencies = [ "pezpallet-session-benchmarking", "pezpallet-staking", "pezpallet-staking-runtime-api", + "pezpallet-staking-score", "pezpallet-state-trie-migration", "pezpallet-sudo", "pezpallet-timestamp", diff --git a/Cargo.toml b/Cargo.toml index 8d839b27..4f52aff7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1516,12 +1516,12 @@ static_assertions = { version = "1.1.0", default-features = false } static_init = { version = "1.0.3" } strum = { version = "0.26.3", default-features = false } # Pezkuwi-subxt (vendored from subxt with pezsp_runtime support) -pezkuwi-subxt = { path = "vendor/pezkuwi-subxt/subxt", version = "0.44.0" } +pezkuwi-subxt = { path = "vendor/pezkuwi-subxt/subxt", version = "0.44.0", default-features = false } pezkuwi-subxt-codegen = { path = "vendor/pezkuwi-subxt/codegen", version = "0.44.0" } -pezkuwi-subxt-core = { path = "vendor/pezkuwi-subxt/core", version = "0.44.0" } -pezkuwi-subxt-lightclient = { path = "vendor/pezkuwi-subxt/lightclient", version = "0.44.0" } +pezkuwi-subxt-core = { path = "vendor/pezkuwi-subxt/core", version = "0.44.0", default-features = false } +pezkuwi-subxt-lightclient = { path = "vendor/pezkuwi-subxt/lightclient", version = "0.44.0", default-features = false } pezkuwi-subxt-macro = { path = "vendor/pezkuwi-subxt/macro", version = "0.44.0" } -pezkuwi-subxt-metadata = { path = "vendor/pezkuwi-subxt/metadata", version = "0.44.0" } +pezkuwi-subxt-metadata = { path = "vendor/pezkuwi-subxt/metadata", version = "0.44.0", default-features = false } pezkuwi-subxt-rpcs = { path = "vendor/pezkuwi-subxt/rpcs", version = "0.44.0" } pezkuwi-subxt-signer = { path = "vendor/pezkuwi-subxt/signer", version = "0.44.0" } pezkuwi-subxt-utils-fetchmetadata = { path = "vendor/pezkuwi-subxt/utils/fetch-metadata", version = "0.44.0" } diff --git a/pezcumulus/teyrchains/pezpallets/identity-kyc/src/benchmarking.rs b/pezcumulus/teyrchains/pezpallets/identity-kyc/src/benchmarking.rs index d96189d9..bf2b7d7c 100644 --- a/pezcumulus/teyrchains/pezpallets/identity-kyc/src/benchmarking.rs +++ b/pezcumulus/teyrchains/pezpallets/identity-kyc/src/benchmarking.rs @@ -59,7 +59,7 @@ mod benchmarks { apply_for_citizenship( RawOrigin::Signed(applicant.clone()), identity_hash, - referrer.clone(), + Some(referrer.clone()), ); assert_eq!(KycStatuses::::get(&applicant), KycLevel::PendingReferral); diff --git a/pezcumulus/teyrchains/pezpallets/identity-kyc/src/lib.rs b/pezcumulus/teyrchains/pezpallets/identity-kyc/src/lib.rs index 4a8c84e5..96f19a06 100644 --- a/pezcumulus/teyrchains/pezpallets/identity-kyc/src/lib.rs +++ b/pezcumulus/teyrchains/pezpallets/identity-kyc/src/lib.rs @@ -317,7 +317,7 @@ pub mod pezpallet { let actual_referrer = referrer .filter(|r| *r != applicant) // Not self-referral .filter(|r| KycStatuses::::get(r) == KycLevel::Approved) // Must be citizen - .unwrap_or_else(|| T::DefaultReferrer::get()); + .unwrap_or_else(T::DefaultReferrer::get); // Verify the actual referrer is valid (including DefaultReferrer) ensure!( @@ -333,13 +333,18 @@ pub mod pezpallet { T::Currency::reserve(&applicant, deposit)?; // Store application (only hash, no personal data) - let application = CitizenshipApplication { identity_hash, referrer: actual_referrer.clone() }; + let application = + CitizenshipApplication { identity_hash, referrer: actual_referrer.clone() }; Applications::::insert(&applicant, application); // Update status KycStatuses::::insert(&applicant, KycLevel::PendingReferral); - Self::deposit_event(Event::CitizenshipApplied { applicant, referrer: actual_referrer, identity_hash }); + Self::deposit_event(Event::CitizenshipApplied { + applicant, + referrer: actual_referrer, + identity_hash, + }); Ok(()) } diff --git a/pezkuwi/runtime/pezkuwichain/src/genesis_config_presets.rs b/pezkuwi/runtime/pezkuwichain/src/genesis_config_presets.rs index bbe4ec2c..9a6db5be 100644 --- a/pezkuwi/runtime/pezkuwichain/src/genesis_config_presets.rs +++ b/pezkuwi/runtime/pezkuwichain/src/genesis_config_presets.rs @@ -29,7 +29,7 @@ use crate::{ BabeConfig, BalancesConfig, ConfigurationConfig, RegistrarConfig, RuntimeGenesisConfig, - SessionConfig, SessionKeys, SudoConfig, BABE_GENESIS_EPOCH_CONFIG, + SessionConfig, SessionKeys, StakingConfig, SudoConfig, BABE_GENESIS_EPOCH_CONFIG, }; #[cfg(not(feature = "std"))] use alloc::format; @@ -37,6 +37,7 @@ use alloc::{vec, vec::Vec}; use pezframe_support::build_struct_json_patch; use pezkuwi_primitives::{AccountId, AssignmentId, SchedulerParams, ValidatorId}; use pezkuwichain_runtime_constants::currency::UNITS as TYR; +use pezpallet_staking::{Forcing, StakerStatus}; use pezsp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use pezsp_consensus_babe::AuthorityId as BabeId; use pezsp_consensus_beefy::ecdsa_crypto::AuthorityId as BeefyId; @@ -44,6 +45,7 @@ use pezsp_consensus_grandpa::AuthorityId as GrandpaId; use pezsp_core::{crypto::get_public_from_string_or_panic, sr25519}; use pezsp_genesis_builder::PresetId; use pezsp_keyring::Sr25519Keyring; +use pezsp_runtime::Perbill; // ============================================================================ // HEZ TOKEN GENESIS CONSTANTS (Total Supply: 200 Million HEZ) @@ -175,9 +177,8 @@ fn default_teyrchains_host_configuration( lookahead: 3, group_rotation_frequency: 20, paras_availability_period: 4, - // num_cores: 0 olmalı çünkü assign_coretime() genesis'te - // her teyrchain için otomatik olarak artırır - num_cores: 0, + // System teyrchains için 2 core gerekli (Asset Hub + People Chain) + num_cores: 2, ..Default::default() }, ..Default::default() @@ -962,14 +963,32 @@ fn pezkuwichain_genesis_config() -> serde_json::Value { }, session: SessionConfig { keys: initial_authorities - .into_iter() + .iter() .map(|x| ( x.0.clone(), - x.0, - pezkuwichain_session_keys(x.2, x.3, x.4, x.5, x.6, x.7) + x.0.clone(), + pezkuwichain_session_keys( + x.2.clone(), + x.3.clone(), + x.4.clone(), + x.5.clone(), + x.6.clone(), + x.7.clone(), + ) )) .collect::>(), }, + staking: StakingConfig { + minimum_validator_count: 1, + validator_count: initial_authorities.len() as u32, + stakers: initial_authorities + .iter() + .map(|x| (x.0.clone(), x.0.clone(), STASH, StakerStatus::::Validator)) + .collect::>(), + invulnerables: initial_authorities.iter().map(|x| x.0.clone()).collect::>(), + force_era: Forcing::ForceAlways, + slash_reward_fraction: Perbill::from_percent(10), + }, babe: BabeConfig { epoch_config: BABE_GENESIS_EPOCH_CONFIG }, sudo: SudoConfig { key: Some(founder_account) }, configuration: ConfigurationConfig { config: default_teyrchains_host_configuration() }, diff --git a/pezkuwi/runtime/pezkuwichain/src/lib.rs b/pezkuwi/runtime/pezkuwichain/src/lib.rs index 9015a738..0c500b9a 100644 --- a/pezkuwi/runtime/pezkuwichain/src/lib.rs +++ b/pezkuwi/runtime/pezkuwichain/src/lib.rs @@ -573,9 +573,7 @@ impl pezpallet_staking::Config for Runtime { /// This is the REAL implementation that accesses actual staking data pub struct RelayStakingInfoProvider; -impl pezpallet_staking_score::StakingInfoProvider - for RelayStakingInfoProvider -{ +impl pezpallet_staking_score::StakingInfoProvider for RelayStakingInfoProvider { fn get_staking_details( who: &AccountId, ) -> Option> {