fix: lower MinTrust thresholds for welati elections, fix CI fmt

Welati MinTrust changes (People Chain 1_020_008 prep):
- Presidential: 600→250, Parliamentary: 300→100
- SpeakerElection: 400→200, ConstitutionalCourt: 750→275
- OfficialRole: 250→75, Endorser: 100→40

Also fix grant_noter_tiki.rs formatting for CI quick-checks.
This commit is contained in:
2026-02-17 04:01:26 +03:00
parent 176fd52ab7
commit f5d865ae0a
4 changed files with 12 additions and 15 deletions
@@ -692,7 +692,7 @@ pub mod pezpallet {
);
let endorser_trust = T::TrustScoreSource::trust_score_of(endorser);
ensure!(endorser_trust >= 100u128, Error::<T>::InsufficientTrustScore);
ensure!(endorser_trust >= 40u128, Error::<T>::InsufficientTrustScore);
}
}
@@ -1219,10 +1219,10 @@ pub mod pezpallet {
/// Minimum Trust Score by election type
pub fn get_required_trust_score(election_type: &ElectionType) -> u128 {
match election_type {
ElectionType::Presidential => 600,
ElectionType::Parliamentary => 300,
ElectionType::SpeakerElection => 400,
ElectionType::ConstitutionalCourt => 750,
ElectionType::Presidential => 250,
ElectionType::Parliamentary => 100,
ElectionType::SpeakerElection => 200,
ElectionType::ConstitutionalCourt => 275,
}
}
@@ -365,11 +365,11 @@ fn vote_on_proposal_works() {
#[test]
fn get_required_trust_score_works() {
ExtBuilder::default().build().execute_with(|| {
assert_eq!(Welati::get_required_trust_score(&ElectionType::Presidential), 600);
assert_eq!(Welati::get_required_trust_score(&ElectionType::Presidential), 250);
assert_eq!(Welati::get_required_trust_score(&ElectionType::Parliamentary), 300);
assert_eq!(Welati::get_required_trust_score(&ElectionType::Parliamentary), 100);
assert_eq!(Welati::get_required_trust_score(&ElectionType::ConstitutionalCourt), 750);
assert_eq!(Welati::get_required_trust_score(&ElectionType::ConstitutionalCourt), 275);
});
}
@@ -1334,7 +1334,7 @@ pub trait OfficialRoleInfo {
impl OfficialRoleInfo for OfficialRole {
fn required_trust_score(&self) -> u128 {
250 // Anayasada belirtilen genel şart
75 // Anayasada belirtilen genel şart
}
fn nominating_minister(&self) -> MinisterRole {
+3 -6
View File
@@ -161,11 +161,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Batch all 21 calls
let batch_call = encode_batch_all(grant_calls);
println!(
"\nBatch call: {} bytes (0x{}...)",
batch_call.len(),
hex::encode(&batch_call[..8])
);
println!("\nBatch call: {} bytes (0x{}...)", batch_call.len(), hex::encode(&batch_call[..8]));
// Connect to relay chain
let api = OnlineClient::<PezkuwiConfig>::from_insecure_url(&relay_url).await?;
@@ -199,7 +195,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("Submitting sudo(xcm.send(batch_all(grant_tiki × 21)))...");
use pezkuwi_subxt::tx::TxStatus;
let tx_progress = api.tx().sign_and_submit_then_watch_default(&sudo_call, &sudo_keypair).await?;
let tx_progress =
api.tx().sign_and_submit_then_watch_default(&sudo_call, &sudo_keypair).await?;
println!("TX: 0x{}", hex::encode(tx_progress.extrinsic_hash().as_ref()));