fix: Complete snowbridge pezpallet rebrand and critical bug fixes
- snowbridge-pezpallet-* → pezsnowbridge-pezpallet-* (201 refs) - pallet/ directories → pezpallet/ (4 locations) - Fixed pezpallet.rs self-include recursion bug - Fixed sc-chain-spec hardcoded crate name in derive macro - Reverted .pezpallet_by_name() to .pallet_by_name() (subxt API) - Added BizinikiwiConfig type alias for zombienet tests - Deleted obsolete session state files Verified: pezsnowbridge-pezpallet-*, pezpallet-staking, pezpallet-staking-async, pezframe-benchmarking-cli all pass cargo check
This commit is contained in:
+3
-3
@@ -51,7 +51,7 @@ pub trait WithRemoteGrandpaChainHelper {
|
||||
InboundPayload = XcmAsPlainPayload,
|
||||
OutboundPayload = XcmAsPlainPayload,
|
||||
> + pezpallet_bridge_relayers::Config<Self::RPI, Reward = Self::RelayerReward>;
|
||||
/// All pallets of this chain, excluding system pallet.
|
||||
/// All pallets of this chain, excluding system pezpallet.
|
||||
type AllPalletsWithoutSystem: OnInitialize<BlockNumberFor<Self::Runtime>>
|
||||
+ OnFinalize<BlockNumberFor<Self::Runtime>>;
|
||||
/// Instance of the `pezpallet-bridge-grandpa`, used to bridge with remote GRANDPA chain.
|
||||
@@ -265,12 +265,12 @@ pub fn free_relay_extrinsic_works<RuntimeHelper>(
|
||||
|
||||
// relayer balance shall not change after relay and para header submissions
|
||||
let initial_relayer_balance =
|
||||
pezpallet_balances::Pallet::<RuntimeHelper::Runtime>::free_balance(
|
||||
pezpallet_balances::Pezpallet::<RuntimeHelper::Runtime>::free_balance(
|
||||
relayer_id_at_this_chain.clone(),
|
||||
);
|
||||
|
||||
// initialize the `FreeHeadersRemaining` storage value
|
||||
pezpallet_bridge_grandpa::Pallet::<RuntimeHelper::Runtime, RuntimeHelper::GPI>::on_initialize(
|
||||
pezpallet_bridge_grandpa::Pezpallet::<RuntimeHelper::Runtime, RuntimeHelper::GPI>::on_initialize(
|
||||
0u32.into(),
|
||||
);
|
||||
|
||||
|
||||
+3
-3
@@ -54,7 +54,7 @@ pub trait WithRemoteTeyrchainHelper {
|
||||
InboundPayload = XcmAsPlainPayload,
|
||||
OutboundPayload = XcmAsPlainPayload,
|
||||
> + pezpallet_bridge_relayers::Config<Self::RPI, Reward = Self::RelayerReward>;
|
||||
/// All pallets of this chain, excluding system pallet.
|
||||
/// All pallets of this chain, excluding system pezpallet.
|
||||
type AllPalletsWithoutSystem: OnInitialize<BlockNumberFor<Self::Runtime>>
|
||||
+ OnFinalize<BlockNumberFor<Self::Runtime>>;
|
||||
/// Instance of the `pezpallet-bridge-grandpa`, used to bridge with remote relay chain.
|
||||
@@ -306,12 +306,12 @@ pub fn free_relay_extrinsic_works<RuntimeHelper>(
|
||||
|
||||
// relayer balance shall not change after relay and para header submissions
|
||||
let initial_relayer_balance =
|
||||
pezpallet_balances::Pallet::<RuntimeHelper::Runtime>::free_balance(
|
||||
pezpallet_balances::Pezpallet::<RuntimeHelper::Runtime>::free_balance(
|
||||
relayer_id_at_this_chain.clone(),
|
||||
);
|
||||
|
||||
// initialize the `FreeHeadersRemaining` storage value
|
||||
pezpallet_bridge_grandpa::Pallet::<RuntimeHelper::Runtime, RuntimeHelper::GPI>::on_initialize(
|
||||
pezpallet_bridge_grandpa::Pezpallet::<RuntimeHelper::Runtime, RuntimeHelper::GPI>::on_initialize(
|
||||
0u32.into(),
|
||||
);
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ impl VerifyTransactionOutcome for Box<dyn VerifyTransactionOutcome> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Checks that the best finalized header hash in the bridge GRANDPA pallet equals to given one.
|
||||
/// Checks that the best finalized header hash in the bridge GRANDPA pezpallet equals to given one.
|
||||
pub struct VerifySubmitGrandpaFinalityProofOutcome<Runtime, GPI>
|
||||
where
|
||||
Runtime: BridgeGrandpaConfig<GPI>,
|
||||
@@ -93,7 +93,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Checks that the best teyrchain header hash in the bridge teyrchains pallet equals to given one.
|
||||
/// Checks that the best teyrchain header hash in the bridge teyrchains pezpallet equals to given one.
|
||||
pub struct VerifySubmitTeyrchainHeaderProofOutcome<Runtime, PPI> {
|
||||
bridged_para_id: u32,
|
||||
expected_best_hash: ParaHash,
|
||||
@@ -129,7 +129,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Checks that the latest delivered nonce in the bridge messages pallet equals to given one.
|
||||
/// Checks that the latest delivered nonce in the bridge messages pezpallet equals to given one.
|
||||
pub struct VerifySubmitMessagesProofOutcome<Runtime: BridgeMessagesConfig<MPI>, MPI: 'static> {
|
||||
lane: LaneIdOf<Runtime, MPI>,
|
||||
expected_nonce: MessageNonce,
|
||||
@@ -222,11 +222,11 @@ where
|
||||
Runtime: pezpallet_balances::Config,
|
||||
{
|
||||
fn verify_outcome(&self) {
|
||||
assert_eq!(pezpallet_balances::Pallet::<Runtime>::free_balance(&self.relayer), self.balance,);
|
||||
assert_eq!(pezpallet_balances::Pezpallet::<Runtime>::free_balance(&self.relayer), self.balance,);
|
||||
}
|
||||
}
|
||||
|
||||
/// Initialize bridge GRANDPA pallet.
|
||||
/// Initialize bridge GRANDPA pezpallet.
|
||||
pub(crate) fn initialize_bridge_grandpa_pallet<Runtime, GPI>(
|
||||
init_data: bp_header_pez_chain::InitializationData<BridgedHeader<Runtime, GPI>>,
|
||||
) where
|
||||
@@ -234,7 +234,7 @@ pub(crate) fn initialize_bridge_grandpa_pallet<Runtime, GPI>(
|
||||
+ pezcumulus_pezpallet_teyrchain_system::Config
|
||||
+ pezpallet_timestamp::Config,
|
||||
{
|
||||
pezpallet_bridge_grandpa::Pallet::<Runtime, GPI>::initialize(
|
||||
pezpallet_bridge_grandpa::Pezpallet::<Runtime, GPI>::initialize(
|
||||
RuntimeHelper::<Runtime>::root_origin(),
|
||||
init_data,
|
||||
)
|
||||
@@ -307,7 +307,7 @@ pub fn relayed_incoming_message_works<Runtime, AllPalletsWithoutSystem, MPI>(
|
||||
2,
|
||||
AccountId::from(alice).into(),
|
||||
);
|
||||
mock_open_hrmp_channel::<Runtime, pezcumulus_pezpallet_teyrchain_system::Pallet<Runtime>>(
|
||||
mock_open_hrmp_channel::<Runtime, pezcumulus_pezpallet_teyrchain_system::Pezpallet<Runtime>>(
|
||||
runtime_para_id.into(),
|
||||
sibling_teyrchain_id.into(),
|
||||
included_head,
|
||||
@@ -325,11 +325,11 @@ pub fn relayed_incoming_message_works<Runtime, AllPalletsWithoutSystem, MPI>(
|
||||
let xcm = vec![Instruction::<()>::ClearOrigin; 42];
|
||||
let expected_dispatch = xcm::latest::Xcm::<()>({
|
||||
let mut expected_instructions = xcm.clone();
|
||||
// dispatch prepends bridge pallet instance
|
||||
// dispatch prepends bridge pezpallet instance
|
||||
expected_instructions.insert(
|
||||
0,
|
||||
DescendOrigin([PalletInstance(
|
||||
<pezpallet_bridge_messages::Pallet<Runtime, MPI> as PalletInfoAccess>::index()
|
||||
<pezpallet_bridge_messages::Pezpallet<Runtime, MPI> as PalletInfoAccess>::index()
|
||||
as u8,
|
||||
)].into()),
|
||||
);
|
||||
@@ -351,7 +351,7 @@ pub fn relayed_incoming_message_works<Runtime, AllPalletsWithoutSystem, MPI>(
|
||||
|
||||
// verify that imported XCM contains original message
|
||||
let imported_xcm =
|
||||
RuntimeHelper::<pezcumulus_pezpallet_xcmp_queue::Pallet<Runtime>>::take_xcm(
|
||||
RuntimeHelper::<pezcumulus_pezpallet_xcmp_queue::Pezpallet<Runtime>>::take_xcm(
|
||||
sibling_teyrchain_id.into(),
|
||||
)
|
||||
.unwrap();
|
||||
@@ -408,7 +408,7 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
{
|
||||
// construct expected bridge configuration
|
||||
let locations =
|
||||
pezpallet_xcm_bridge_hub::Pallet::<Runtime, XcmOverBridgePalletInstance>::bridge_locations(
|
||||
pezpallet_xcm_bridge_hub::Pezpallet::<Runtime, XcmOverBridgePalletInstance>::bridge_locations(
|
||||
source.clone().into(),
|
||||
destination.clone().into(),
|
||||
)
|
||||
@@ -426,7 +426,7 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
let balance_needed = <Runtime as pezpallet_balances::Config>::ExistentialDeposit::get() + bridge_deposit.into();
|
||||
|
||||
let source_account_id = LocationToAccountId::convert_location(&source).expect("valid location");
|
||||
let _ = <pezpallet_balances::Pallet<Runtime>>::mint_into(&source_account_id, balance_needed)
|
||||
let _ = <pezpallet_balances::Pezpallet<Runtime>>::mint_into(&source_account_id, balance_needed)
|
||||
.expect("mint_into passes");
|
||||
};
|
||||
|
||||
@@ -440,7 +440,7 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
let source_account_id =
|
||||
LocationToAccountId::convert_location(&source).expect("valid location");
|
||||
let _ =
|
||||
<pezpallet_balances::Pallet<Runtime>>::mint_into(&source_account_id, balance_needed)
|
||||
<pezpallet_balances::Pezpallet<Runtime>>::mint_into(&source_account_id, balance_needed)
|
||||
.expect("mint_into passes");
|
||||
Some(buy_execution_fee)
|
||||
} else {
|
||||
@@ -458,7 +458,7 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
|
||||
// check state
|
||||
assert_ok!(
|
||||
pezpallet_xcm_bridge_hub::Pallet::<Runtime, XcmOverBridgePalletInstance>::do_try_state()
|
||||
pezpallet_xcm_bridge_hub::Pezpallet::<Runtime, XcmOverBridgePalletInstance>::do_try_state()
|
||||
);
|
||||
|
||||
// return locations
|
||||
@@ -509,7 +509,7 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
{
|
||||
// insert bridge data directly to the storage
|
||||
assert_ok!(
|
||||
pezpallet_xcm_bridge_hub::Pallet::<Runtime, XcmOverBridgePalletInstance>::do_open_bridge(
|
||||
pezpallet_xcm_bridge_hub::Pezpallet::<Runtime, XcmOverBridgePalletInstance>::do_open_bridge(
|
||||
Box::new(locations),
|
||||
lane_id,
|
||||
true
|
||||
@@ -534,7 +534,7 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
{
|
||||
// construct expected bridge configuration
|
||||
let locations =
|
||||
pezpallet_xcm_bridge_hub::Pallet::<Runtime, XcmOverBridgePalletInstance>::bridge_locations(
|
||||
pezpallet_xcm_bridge_hub::Pezpallet::<Runtime, XcmOverBridgePalletInstance>::bridge_locations(
|
||||
expected_source.clone().into(),
|
||||
bridge_destination_universal_location.clone().into(),
|
||||
)
|
||||
@@ -555,7 +555,7 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
let source_account_id =
|
||||
LocationToAccountId::convert_location(&expected_source).expect("valid location");
|
||||
let _ =
|
||||
<pezpallet_balances::Pallet<Runtime>>::mint_into(&source_account_id, balance_needed)
|
||||
<pezpallet_balances::Pezpallet<Runtime>>::mint_into(&source_account_id, balance_needed)
|
||||
.expect("mint_into passes");
|
||||
Some(buy_execution_fee)
|
||||
} else {
|
||||
@@ -589,7 +589,7 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
|
||||
// check state
|
||||
assert_ok!(
|
||||
pezpallet_xcm_bridge_hub::Pallet::<Runtime, XcmOverBridgePalletInstance>::do_try_state()
|
||||
pezpallet_xcm_bridge_hub::Pezpallet::<Runtime, XcmOverBridgePalletInstance>::do_try_state()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ pub fn initialize_bridge_by_governance_works<Runtime, GrandpaPalletInstance>(
|
||||
})
|
||||
}
|
||||
|
||||
/// Test-case makes sure that `Runtime` can change bridge GRANDPA pallet operating mode via
|
||||
/// Test-case makes sure that `Runtime` can change bridge GRANDPA pezpallet operating mode via
|
||||
/// governance-like call.
|
||||
pub fn change_bridge_grandpa_pallet_mode_by_governance_works<Runtime, GrandpaPalletInstance>(
|
||||
collator_session_key: CollatorSessionKeys<Runtime>,
|
||||
@@ -191,7 +191,7 @@ pub fn change_bridge_grandpa_pallet_mode_by_governance_works<Runtime, GrandpaPal
|
||||
});
|
||||
}
|
||||
|
||||
/// Test-case makes sure that `Runtime` can change bridge teyrchains pallet operating mode via
|
||||
/// Test-case makes sure that `Runtime` can change bridge teyrchains pezpallet operating mode via
|
||||
/// governance-like call.
|
||||
pub fn change_bridge_teyrchains_pallet_mode_by_governance_works<Runtime, TeyrchainsPalletInstance>(
|
||||
collator_session_key: CollatorSessionKeys<Runtime>,
|
||||
@@ -244,7 +244,7 @@ pub fn change_bridge_teyrchains_pallet_mode_by_governance_works<Runtime, Teyrcha
|
||||
});
|
||||
}
|
||||
|
||||
/// Test-case makes sure that `Runtime` can change bridge messaging pallet operating mode via
|
||||
/// Test-case makes sure that `Runtime` can change bridge messaging pezpallet operating mode via
|
||||
/// governance-like call.
|
||||
pub fn change_bridge_messages_pallet_mode_by_governance_works<Runtime, MessagesPalletInstance>(
|
||||
collator_session_key: CollatorSessionKeys<Runtime>,
|
||||
@@ -406,7 +406,7 @@ pub fn handle_export_message_from_system_teyrchain_to_outbound_queue_works<
|
||||
);
|
||||
|
||||
// check events
|
||||
let mut events = <pezframe_system::Pallet<Runtime>>::events()
|
||||
let mut events = <pezframe_system::Pezpallet<Runtime>>::events()
|
||||
.into_iter()
|
||||
.filter_map(|e| unwrap_pallet_bridge_messages_event(e.event.encode()));
|
||||
assert!(events.any(|e| matches!(e, pezpallet_bridge_messages::Event::MessageAccepted { .. })));
|
||||
@@ -499,7 +499,7 @@ pub fn message_dispatch_routing_works<
|
||||
);
|
||||
|
||||
// check events - UpwardMessageSent
|
||||
let mut events = <pezframe_system::Pallet<Runtime>>::events()
|
||||
let mut events = <pezframe_system::Pezpallet<Runtime>>::events()
|
||||
.into_iter()
|
||||
.filter_map(|e| unwrap_pezcumulus_pezpallet_teyrchain_system_event(e.event.encode()));
|
||||
assert!(events.any(|e| matches!(
|
||||
@@ -534,7 +534,7 @@ pub fn message_dispatch_routing_works<
|
||||
|
||||
// check events - no XcmpMessageSent
|
||||
assert_eq!(
|
||||
<pezframe_system::Pallet<Runtime>>::events()
|
||||
<pezframe_system::Pezpallet<Runtime>>::events()
|
||||
.into_iter()
|
||||
.filter_map(|e| unwrap_pezcumulus_pezpallet_xcmp_queue_event(e.event.encode()))
|
||||
.count(),
|
||||
@@ -562,7 +562,7 @@ pub fn message_dispatch_routing_works<
|
||||
);
|
||||
|
||||
// check events - XcmpMessageSent
|
||||
let mut events = <pezframe_system::Pallet<Runtime>>::events()
|
||||
let mut events = <pezframe_system::Pezpallet<Runtime>>::events()
|
||||
.into_iter()
|
||||
.filter_map(|e| unwrap_pezcumulus_pezpallet_xcmp_queue_event(e.event.encode()));
|
||||
assert!(
|
||||
@@ -689,7 +689,7 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
{
|
||||
run_test::<Runtime, _>(collator_session_key, runtime_para_id, vec![], || {
|
||||
// construct expected bridge configuration
|
||||
let locations = pezpallet_xcm_bridge_hub::Pallet::<Runtime, XcmOverBridgePalletInstance>::bridge_locations(
|
||||
let locations = pezpallet_xcm_bridge_hub::Pezpallet::<Runtime, XcmOverBridgePalletInstance>::bridge_locations(
|
||||
expected_source.clone().into(),
|
||||
destination.clone().into(),
|
||||
).expect("valid bridge locations");
|
||||
|
||||
@@ -47,7 +47,7 @@ pub fn prepare_inbound_xcm(xcm_message: Xcm<()>, destination: InteriorLocation)
|
||||
}
|
||||
|
||||
/// Helper that creates InitializationData mock data, that can be used to initialize bridge
|
||||
/// GRANDPA pallet
|
||||
/// GRANDPA pezpallet
|
||||
pub fn initialization_data<
|
||||
Runtime: pezpallet_bridge_grandpa::Config<GrandpaPalletInstance>,
|
||||
GrandpaPalletInstance: 'static,
|
||||
|
||||
Reference in New Issue
Block a user