chore: cargo fmt + regenerate umbrella crate
This commit is contained in:
@@ -93,8 +93,8 @@ use pezframe_support::{
|
|||||||
parameter_types,
|
parameter_types,
|
||||||
traits::{
|
traits::{
|
||||||
fungible::HoldConsideration, EitherOf, EitherOfDiverse, EnsureOriginWithArg,
|
fungible::HoldConsideration, EitherOf, EitherOfDiverse, EnsureOriginWithArg,
|
||||||
InstanceFilter, KeyOwnerProofSystem, LinearStoragePrice, PrivilegeCmp,
|
InstanceFilter, KeyOwnerProofSystem, LinearStoragePrice, PrivilegeCmp, ProcessMessage,
|
||||||
ProcessMessage, ProcessMessageError, WithdrawReasons,
|
ProcessMessageError, WithdrawReasons,
|
||||||
},
|
},
|
||||||
weights::{ConstantMultiplier, WeightMeter},
|
weights::{ConstantMultiplier, WeightMeter},
|
||||||
PalletId,
|
PalletId,
|
||||||
@@ -477,11 +477,12 @@ impl pezpallet_session::SessionManager<AccountId> for NoopFallback {
|
|||||||
fn end_session(_: SessionIndex) {}
|
fn end_session(_: SessionIndex) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl pezsp_staking::offence::OnOffenceHandler<
|
impl
|
||||||
AccountId,
|
pezsp_staking::offence::OnOffenceHandler<
|
||||||
(AccountId, pezsp_staking::Exposure<AccountId, Balance>),
|
AccountId,
|
||||||
Weight,
|
(AccountId, pezsp_staking::Exposure<AccountId, Balance>),
|
||||||
> for NoopFallback
|
Weight,
|
||||||
|
> for NoopFallback
|
||||||
{
|
{
|
||||||
fn on_offence(
|
fn on_offence(
|
||||||
_offenders: &[pezsp_staking::offence::OffenceDetails<
|
_offenders: &[pezsp_staking::offence::OffenceDetails<
|
||||||
@@ -648,7 +649,6 @@ impl ah_client::Config for Runtime {
|
|||||||
type MaxSessionReportRetries = ConstU32<64>;
|
type MaxSessionReportRetries = ConstU32<64>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// =====================================================
|
// =====================================================
|
||||||
// VALIDATOR POOL CONFIGURATION (TNPoS Shadow Mode)
|
// VALIDATOR POOL CONFIGURATION (TNPoS Shadow Mode)
|
||||||
// =====================================================
|
// =====================================================
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "pezkuwi-sdk"
|
name = "pezkuwi-sdk"
|
||||||
version = "0.0.0"
|
|
||||||
description = "Pezkuwi SDK umbrella crate."
|
description = "Pezkuwi SDK umbrella crate."
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
||||||
|
|||||||
+9
-35
@@ -65,11 +65,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
// Load WASM
|
// Load WASM
|
||||||
let wasm_data = std::fs::read(&wasm_path)?;
|
let wasm_data = std::fs::read(&wasm_path)?;
|
||||||
println!(
|
println!(" WASM: {} ({:.2} MB)", wasm_path, wasm_data.len() as f64 / 1_048_576.0);
|
||||||
" WASM: {} ({:.2} MB)",
|
|
||||||
wasm_path,
|
|
||||||
wasm_data.len() as f64 / 1_048_576.0
|
|
||||||
);
|
|
||||||
|
|
||||||
// Blake2-256 hash of WASM
|
// Blake2-256 hash of WASM
|
||||||
let code_hash = pezsp_crypto_hashing::blake2_256(&wasm_data);
|
let code_hash = pezsp_crypto_hashing::blake2_256(&wasm_data);
|
||||||
@@ -77,11 +73,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
// Connect to RC
|
// Connect to RC
|
||||||
let rc_api = OnlineClient::<PezkuwiConfig>::from_insecure_url(&rc_url).await?;
|
let rc_api = OnlineClient::<PezkuwiConfig>::from_insecure_url(&rc_url).await?;
|
||||||
println!(
|
println!(" RC connected: {} (spec {})", rc_url, rc_api.runtime_version().spec_version);
|
||||||
" RC connected: {} (spec {})",
|
|
||||||
rc_url,
|
|
||||||
rc_api.runtime_version().spec_version
|
|
||||||
);
|
|
||||||
|
|
||||||
// Connect to AH
|
// Connect to AH
|
||||||
let ah_api = OnlineClient::<PezkuwiConfig>::from_insecure_url(&ah_url).await?;
|
let ah_api = OnlineClient::<PezkuwiConfig>::from_insecure_url(&ah_url).await?;
|
||||||
@@ -109,10 +101,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
"interior",
|
"interior",
|
||||||
Value::unnamed_variant(
|
Value::unnamed_variant(
|
||||||
"X1",
|
"X1",
|
||||||
vec![Value::unnamed_variant(
|
vec![Value::unnamed_variant("Teyrchain", vec![Value::u128(AH_PARA_ID)])],
|
||||||
"Teyrchain",
|
|
||||||
vec![Value::u128(AH_PARA_ID)],
|
|
||||||
)],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
])],
|
])],
|
||||||
@@ -158,10 +147,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
let progress = rc_api
|
let progress = rc_api.tx().sign_and_submit_then_watch_default(&sudo_tx, &sudo_keypair).await?;
|
||||||
.tx()
|
|
||||||
.sign_and_submit_then_watch_default(&sudo_tx, &sudo_keypair)
|
|
||||||
.await?;
|
|
||||||
let events = progress.wait_for_finalized_success().await?;
|
let events = progress.wait_for_finalized_success().await?;
|
||||||
|
|
||||||
let mut sent = false;
|
let mut sent = false;
|
||||||
@@ -256,11 +242,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
// 10,000 HEZ = 10_000 * 10^12 (12 decimals, NOT 18)
|
// 10,000 HEZ = 10_000 * 10^12 (12 decimals, NOT 18)
|
||||||
let amount: u128 = 10_000_000_000_000_000u128; // 10,000 HEZ
|
let amount: u128 = 10_000_000_000_000_000u128; // 10,000 HEZ
|
||||||
let amount_bytes = amount.to_le_bytes();
|
let amount_bytes = amount.to_le_bytes();
|
||||||
let significant = amount_bytes
|
let significant = amount_bytes.iter().rposition(|&b| b != 0).map(|i| i + 1).unwrap_or(1);
|
||||||
.iter()
|
|
||||||
.rposition(|&b| b != 0)
|
|
||||||
.map(|i| i + 1)
|
|
||||||
.unwrap_or(1);
|
|
||||||
let byte_len = significant.max(4);
|
let byte_len = significant.max(4);
|
||||||
fund_call.push(((byte_len as u8 - 4) << 2) | 0b11);
|
fund_call.push(((byte_len as u8 - 4) << 2) | 0b11);
|
||||||
fund_call.extend_from_slice(&amount_bytes[..byte_len]);
|
fund_call.extend_from_slice(&amount_bytes[..byte_len]);
|
||||||
@@ -273,10 +255,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
"interior",
|
"interior",
|
||||||
Value::unnamed_variant(
|
Value::unnamed_variant(
|
||||||
"X1",
|
"X1",
|
||||||
vec![Value::unnamed_variant(
|
vec![Value::unnamed_variant("Teyrchain", vec![Value::u128(AH_PARA_ID)])],
|
||||||
"Teyrchain",
|
|
||||||
vec![Value::u128(AH_PARA_ID)],
|
|
||||||
)],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
])],
|
])],
|
||||||
@@ -309,10 +288,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
])],
|
])],
|
||||||
);
|
);
|
||||||
|
|
||||||
let fund_xcm =
|
let fund_xcm = pezkuwi_subxt::dynamic::tx("XcmPallet", "send", vec![fund_dest, fund_msg]);
|
||||||
pezkuwi_subxt::dynamic::tx("XcmPallet", "send", vec![fund_dest, fund_msg]);
|
let fund_sudo = pezkuwi_subxt::dynamic::tx("Sudo", "sudo", vec![fund_xcm.into_value()]);
|
||||||
let fund_sudo =
|
|
||||||
pezkuwi_subxt::dynamic::tx("Sudo", "sudo", vec![fund_xcm.into_value()]);
|
|
||||||
|
|
||||||
let progress = rc_api
|
let progress = rc_api
|
||||||
.tx()
|
.tx()
|
||||||
@@ -383,10 +360,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
verified = true;
|
verified = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
println!(
|
println!(" Attempt {}/10: spec still {} — waiting...", attempt, new_spec);
|
||||||
" Attempt {}/10: spec still {} — waiting...",
|
|
||||||
attempt, new_spec
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if !verified {
|
if !verified {
|
||||||
|
|||||||
+7
-26
@@ -75,11 +75,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
// Connect to RC
|
// Connect to RC
|
||||||
let rc_api = OnlineClient::<PezkuwiConfig>::from_insecure_url(&rc_url).await?;
|
let rc_api = OnlineClient::<PezkuwiConfig>::from_insecure_url(&rc_url).await?;
|
||||||
println!(
|
println!(" RC connected: {} (spec {})", rc_url, rc_api.runtime_version().spec_version);
|
||||||
" RC connected: {} (spec {})",
|
|
||||||
rc_url,
|
|
||||||
rc_api.runtime_version().spec_version
|
|
||||||
);
|
|
||||||
|
|
||||||
// Connect to People Chain
|
// Connect to People Chain
|
||||||
let people_api = OnlineClient::<PezkuwiConfig>::from_insecure_url(&people_url).await?;
|
let people_api = OnlineClient::<PezkuwiConfig>::from_insecure_url(&people_url).await?;
|
||||||
@@ -107,10 +103,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
"interior",
|
"interior",
|
||||||
Value::unnamed_variant(
|
Value::unnamed_variant(
|
||||||
"X1",
|
"X1",
|
||||||
vec![Value::unnamed_variant(
|
vec![Value::unnamed_variant("Teyrchain", vec![Value::u128(PEOPLE_PARA_ID)])],
|
||||||
"Teyrchain",
|
|
||||||
vec![Value::u128(PEOPLE_PARA_ID)],
|
|
||||||
)],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
])],
|
])],
|
||||||
@@ -156,10 +149,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
let progress = rc_api
|
let progress = rc_api.tx().sign_and_submit_then_watch_default(&sudo_tx, &sudo_keypair).await?;
|
||||||
.tx()
|
|
||||||
.sign_and_submit_then_watch_default(&sudo_tx, &sudo_keypair)
|
|
||||||
.await?;
|
|
||||||
let events = progress.wait_for_finalized_success().await?;
|
let events = progress.wait_for_finalized_success().await?;
|
||||||
|
|
||||||
let mut sent = false;
|
let mut sent = false;
|
||||||
@@ -257,11 +247,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
// Generous amount to cover apply_authorized_upgrade fee (1.5MB extrinsic)
|
// Generous amount to cover apply_authorized_upgrade fee (1.5MB extrinsic)
|
||||||
let amount: u128 = 10_000_000_000_000_000u128; // 10,000 HEZ
|
let amount: u128 = 10_000_000_000_000_000u128; // 10,000 HEZ
|
||||||
let amount_bytes = amount.to_le_bytes();
|
let amount_bytes = amount.to_le_bytes();
|
||||||
let significant = amount_bytes
|
let significant = amount_bytes.iter().rposition(|&b| b != 0).map(|i| i + 1).unwrap_or(1);
|
||||||
.iter()
|
|
||||||
.rposition(|&b| b != 0)
|
|
||||||
.map(|i| i + 1)
|
|
||||||
.unwrap_or(1);
|
|
||||||
let byte_len = significant.max(4);
|
let byte_len = significant.max(4);
|
||||||
fund_call.push(((byte_len as u8 - 4) << 2) | 0b11);
|
fund_call.push(((byte_len as u8 - 4) << 2) | 0b11);
|
||||||
fund_call.extend_from_slice(&amount_bytes[..byte_len]);
|
fund_call.extend_from_slice(&amount_bytes[..byte_len]);
|
||||||
@@ -310,10 +296,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
])],
|
])],
|
||||||
);
|
);
|
||||||
|
|
||||||
let fund_xcm =
|
let fund_xcm = pezkuwi_subxt::dynamic::tx("XcmPallet", "send", vec![fund_dest, fund_msg]);
|
||||||
pezkuwi_subxt::dynamic::tx("XcmPallet", "send", vec![fund_dest, fund_msg]);
|
let fund_sudo = pezkuwi_subxt::dynamic::tx("Sudo", "sudo", vec![fund_xcm.into_value()]);
|
||||||
let fund_sudo =
|
|
||||||
pezkuwi_subxt::dynamic::tx("Sudo", "sudo", vec![fund_xcm.into_value()]);
|
|
||||||
|
|
||||||
let progress = rc_api
|
let progress = rc_api
|
||||||
.tx()
|
.tx()
|
||||||
@@ -375,10 +359,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
let people_api2 = OnlineClient::<PezkuwiConfig>::from_insecure_url(&people_url).await?;
|
let people_api2 = OnlineClient::<PezkuwiConfig>::from_insecure_url(&people_url).await?;
|
||||||
let new_spec = people_api2.runtime_version().spec_version;
|
let new_spec = people_api2.runtime_version().spec_version;
|
||||||
println!(
|
println!("\n People Chain spec_version: {} → {}", old_spec, new_spec);
|
||||||
"\n People Chain spec_version: {} → {}",
|
|
||||||
old_spec, new_spec
|
|
||||||
);
|
|
||||||
|
|
||||||
if new_spec > old_spec {
|
if new_spec > old_spec {
|
||||||
println!(" UPGRADE VERIFIED!");
|
println!(" UPGRADE VERIFIED!");
|
||||||
|
|||||||
+2
-7
@@ -55,11 +55,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
// Load WASM
|
// Load WASM
|
||||||
let wasm_data = std::fs::read(&wasm_path)?;
|
let wasm_data = std::fs::read(&wasm_path)?;
|
||||||
println!(
|
println!(" WASM: {} ({:.2} MB)", wasm_path, wasm_data.len() as f64 / 1_048_576.0);
|
||||||
" WASM: {} ({:.2} MB)",
|
|
||||||
wasm_path,
|
|
||||||
wasm_data.len() as f64 / 1_048_576.0
|
|
||||||
);
|
|
||||||
let code_hash = pezsp_crypto_hashing::blake2_256(&wasm_data);
|
let code_hash = pezsp_crypto_hashing::blake2_256(&wasm_data);
|
||||||
println!(" Code hash: 0x{}", hex::encode(code_hash));
|
println!(" Code hash: 0x{}", hex::encode(code_hash));
|
||||||
|
|
||||||
@@ -91,8 +87,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
let tx_progress =
|
let tx_progress = api.tx().sign_and_submit_then_watch_default(&sudo_tx, &sudo_keypair).await?;
|
||||||
api.tx().sign_and_submit_then_watch_default(&sudo_tx, &sudo_keypair).await?;
|
|
||||||
println!(" TX: 0x{}", hex::encode(tx_progress.extrinsic_hash().as_ref()));
|
println!(" TX: 0x{}", hex::encode(tx_progress.extrinsic_hash().as_ref()));
|
||||||
|
|
||||||
let mut progress = tx_progress;
|
let mut progress = tx_progress;
|
||||||
|
|||||||
Reference in New Issue
Block a user