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)
This commit is contained in:
+4
-6
@@ -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/**",
|
||||
]
|
||||
|
||||
|
||||
Generated
+1
@@ -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",
|
||||
|
||||
+4
-4
@@ -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" }
|
||||
|
||||
@@ -59,7 +59,7 @@ mod benchmarks {
|
||||
apply_for_citizenship(
|
||||
RawOrigin::Signed(applicant.clone()),
|
||||
identity_hash,
|
||||
referrer.clone(),
|
||||
Some(referrer.clone()),
|
||||
);
|
||||
|
||||
assert_eq!(KycStatuses::<T>::get(&applicant), KycLevel::PendingReferral);
|
||||
|
||||
@@ -317,7 +317,7 @@ pub mod pezpallet {
|
||||
let actual_referrer = referrer
|
||||
.filter(|r| *r != applicant) // Not self-referral
|
||||
.filter(|r| KycStatuses::<T>::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::<T>::insert(&applicant, application);
|
||||
|
||||
// Update status
|
||||
KycStatuses::<T>::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(())
|
||||
}
|
||||
|
||||
|
||||
@@ -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::<Vec<_>>(),
|
||||
},
|
||||
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::<AccountId>::Validator))
|
||||
.collect::<Vec<_>>(),
|
||||
invulnerables: initial_authorities.iter().map(|x| x.0.clone()).collect::<Vec<_>>(),
|
||||
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() },
|
||||
|
||||
@@ -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<AccountId, Balance>
|
||||
for RelayStakingInfoProvider
|
||||
{
|
||||
impl pezpallet_staking_score::StakingInfoProvider<AccountId, Balance> for RelayStakingInfoProvider {
|
||||
fn get_staking_details(
|
||||
who: &AccountId,
|
||||
) -> Option<pezpallet_staking_score::StakingDetails<Balance>> {
|
||||
|
||||
Reference in New Issue
Block a user