chore: regenerate umbrella crate, fix feature propagation
This commit is contained in:
+1
-1
@@ -24,10 +24,10 @@ use scale_info::TypeInfo;
|
||||
|
||||
pub use bp_bridge_hub_pezcumulus::*;
|
||||
use bp_messages::*;
|
||||
pub use bp_xcm_bridge_hub_router::XcmBridgeHubRouterCall;
|
||||
use pezbp_runtime::{
|
||||
decl_bridge_finality_runtime_apis, decl_bridge_messages_runtime_apis, Chain, ChainId, Teyrchain,
|
||||
};
|
||||
pub use bp_xcm_bridge_hub_router::XcmBridgeHubRouterCall;
|
||||
use pezframe_support::{
|
||||
dispatch::DispatchClass,
|
||||
pezsp_runtime::{MultiAddress, MultiSigner, RuntimeDebug, StateVersion},
|
||||
|
||||
+1
-1
@@ -25,9 +25,9 @@ use crate::{
|
||||
*,
|
||||
};
|
||||
use alloc::{vec, vec::Vec};
|
||||
use hex_literal::hex;
|
||||
use pezcumulus_primitives_core::ParaId;
|
||||
use pezframe_support::build_struct_json_patch;
|
||||
use hex_literal::hex;
|
||||
use pezsp_core::crypto::UncheckedInto;
|
||||
use pezsp_genesis_builder::PresetId;
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
|
||||
@@ -43,7 +43,9 @@ use assets_common::{
|
||||
AssetIdForPoolAssets, AssetIdForPoolAssetsConvert, AssetIdForTrustBackedAssetsConvert,
|
||||
};
|
||||
use bp_asset_hub_pezkuwichain::CreateForeignAssetDeposit;
|
||||
use pezcumulus_pezpallet_teyrchain_system::{RelayNumberMonotonicallyIncreases, RelaychainDataProvider};
|
||||
use pezcumulus_pezpallet_teyrchain_system::{
|
||||
RelayNumberMonotonicallyIncreases, RelaychainDataProvider,
|
||||
};
|
||||
use pezcumulus_primitives_core::AggregateMessageOrigin;
|
||||
use pezsp_api::impl_runtime_apis;
|
||||
use pezsp_core::{crypto::KeyTypeId, OpaqueMetadata};
|
||||
@@ -104,8 +106,8 @@ mod tests;
|
||||
pub use pezsp_runtime::BuildStorage;
|
||||
|
||||
// Pezkuwi imports
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
use pezkuwi_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
use xcm::latest::prelude::{
|
||||
Asset, Assets as XcmAssets, Fungible, Here, InteriorLocation, Junction, Junction::*, Location,
|
||||
@@ -658,8 +660,9 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
|
||||
RuntimeCall::Uniques(pezpallet_uniques::Call::set_collection_metadata { .. }) |
|
||||
RuntimeCall::Uniques(pezpallet_uniques::Call::clear_metadata { .. }) |
|
||||
RuntimeCall::Uniques(pezpallet_uniques::Call::clear_attribute { .. }) |
|
||||
RuntimeCall::Uniques(pezpallet_uniques::Call::clear_collection_metadata { .. }) |
|
||||
RuntimeCall::Uniques(pezpallet_uniques::Call::set_collection_max_supply { .. }) |
|
||||
RuntimeCall::Uniques(
|
||||
pezpallet_uniques::Call::clear_collection_metadata { .. }
|
||||
) | RuntimeCall::Uniques(pezpallet_uniques::Call::set_collection_max_supply { .. }) |
|
||||
RuntimeCall::Utility { .. } |
|
||||
RuntimeCall::Multisig { .. }
|
||||
),
|
||||
@@ -1151,7 +1154,8 @@ impl pezpallet_treasury::Config for Runtime {
|
||||
type AssetKind = ();
|
||||
type Beneficiary = AccountId;
|
||||
type BeneficiaryLookup = pezsp_runtime::traits::IdentityLookup<Self::Beneficiary>;
|
||||
type Paymaster = pezframe_support::traits::tokens::pay::PayFromAccount<Balances, TreasuryAccount>;
|
||||
type Paymaster =
|
||||
pezframe_support::traits::tokens::pay::PayFromAccount<Balances, TreasuryAccount>;
|
||||
type BalanceConverter = pezframe_support::traits::tokens::UnityAssetBalanceConversion;
|
||||
type PayoutPeriod = PayoutSpendPeriod;
|
||||
type BlockNumberProvider = pezframe_system::Pezpallet<Runtime>;
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
use super::*;
|
||||
use pezcumulus_primitives_core::relay_chain::SessionIndex;
|
||||
use pezframe_election_provider_support::{ElectionDataProvider, SequentialPhragmen};
|
||||
use pezkuwi_runtime_common::{prod_or_fast, BalanceToU256, U256ToBalance};
|
||||
use pezpallet_election_provider_multi_block::{self as multi_block, SolutionAccuracyOf};
|
||||
use pezpallet_staking_async::UseValidatorsMap;
|
||||
use pezpallet_staking_async_rc_client as rc_client;
|
||||
use pezkuwi_runtime_common::{prod_or_fast, BalanceToU256, U256ToBalance};
|
||||
use pezsp_runtime::{
|
||||
transaction_validity::TransactionPriority, FixedPointNumber, FixedU128, SaturatedConversion,
|
||||
};
|
||||
@@ -139,7 +139,8 @@ impl multi_block::verifier::Config for Runtime {
|
||||
type MaxBackersPerWinner = MaxBackersPerWinner;
|
||||
type MaxBackersPerWinnerFinal = MaxBackersPerWinnerFinal;
|
||||
type SolutionDataProvider = MultiBlockElectionSigned;
|
||||
type WeightInfo = weights::pezpallet_election_provider_multi_block_verifier::WeightInfo<Runtime>;
|
||||
type WeightInfo =
|
||||
weights::pezpallet_election_provider_multi_block_verifier::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -178,7 +179,8 @@ impl multi_block::unsigned::Config for Runtime {
|
||||
type OffchainSolver = SequentialPhragmen<AccountId, SolutionAccuracyOf<Runtime>>;
|
||||
type MinerTxPriority = MinerTxPriority;
|
||||
type OffchainRepeat = OffchainRepeat;
|
||||
type WeightInfo = weights::pezpallet_election_provider_multi_block_unsigned::WeightInfo<Runtime>;
|
||||
type WeightInfo =
|
||||
weights::pezpallet_election_provider_multi_block_unsigned::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -288,7 +290,8 @@ impl pezpallet_staking_async::Config for Runtime {
|
||||
type VoterList = VoterList;
|
||||
type TargetList = UseValidatorsMap<Self>;
|
||||
type MaxValidatorSet = MaxValidatorSet;
|
||||
type NominationsQuota = pezpallet_staking_async::FixedNominationsQuota<{ MaxNominations::get() }>;
|
||||
type NominationsQuota =
|
||||
pezpallet_staking_async::FixedNominationsQuota<{ MaxNominations::get() }>;
|
||||
type MaxUnlockingChunks = pezframe_support::traits::ConstU32<32>;
|
||||
type HistoryDepth = pezframe_support::traits::ConstU32<84>;
|
||||
type MaxControllersInDeprecationBatch = MaxControllersInDeprecationBatch;
|
||||
|
||||
@@ -27,7 +27,8 @@ fn sane_block_weight() {
|
||||
use pezpallet_balances::WeightInfo;
|
||||
let block = RuntimeBlockWeights::get().max_block;
|
||||
let base = RuntimeBlockWeights::get().get(DispatchClass::Normal).base_extrinsic;
|
||||
let transfer = base + weights::pezpallet_balances::WeightInfo::<Runtime>::transfer_allow_death();
|
||||
let transfer =
|
||||
base + weights::pezpallet_balances::WeightInfo::<Runtime>::transfer_allow_death();
|
||||
|
||||
let fit = block.checked_div_per_component(&transfer).unwrap_or_default();
|
||||
assert!(fit >= 1000, "{} should be at least 1000", fit);
|
||||
@@ -38,7 +39,8 @@ fn sane_block_weight() {
|
||||
fn sane_transfer_fee() {
|
||||
use pezpallet_balances::WeightInfo;
|
||||
let base = RuntimeBlockWeights::get().get(DispatchClass::Normal).base_extrinsic;
|
||||
let transfer = base + weights::pezpallet_balances::WeightInfo::<Runtime>::transfer_allow_death();
|
||||
let transfer =
|
||||
base + weights::pezpallet_balances::WeightInfo::<Runtime>::transfer_allow_death();
|
||||
|
||||
let fee: Balance = fee::WeightToFee::weight_to_fee(&transfer);
|
||||
assert!(fee <= CENTS, "{} MILLICENTS should be at most 1000", fee / MILLICENTS);
|
||||
|
||||
@@ -15,10 +15,11 @@
|
||||
// limitations under the License.
|
||||
|
||||
pub mod block_weights;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod paritydb_weights;
|
||||
pub mod pezcumulus_pezpallet_teyrchain_system;
|
||||
pub mod pezcumulus_pezpallet_weight_reclaim;
|
||||
pub mod pezcumulus_pezpallet_xcmp_queue;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod pezframe_system;
|
||||
pub mod pezframe_system_extensions;
|
||||
pub mod pezpallet_asset_conversion;
|
||||
@@ -49,7 +50,6 @@ pub mod pezpallet_uniques;
|
||||
pub mod pezpallet_utility;
|
||||
pub mod pezpallet_xcm;
|
||||
pub mod pezpallet_xcm_bridge_hub_router;
|
||||
pub mod paritydb_weights;
|
||||
pub mod rocksdb_weights;
|
||||
pub mod xcm;
|
||||
|
||||
|
||||
@@ -35,10 +35,10 @@ use pezframe_support::{
|
||||
},
|
||||
};
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough};
|
||||
use pezkuwi_runtime_common::xcm_sender::ExponentialPrice;
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use pezkuwichain_runtime_constants::system_teyrchain::ASSET_HUB_ID;
|
||||
use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough};
|
||||
use pezsp_runtime::traits::{AccountIdConversion, TryConvertInto};
|
||||
use testnet_teyrchains_constants::pezkuwichain::snowbridge::{
|
||||
EthereumNetwork, INBOUND_QUEUE_PALLET_INDEX,
|
||||
@@ -271,8 +271,8 @@ pub type Barrier = TrailingSetTopicAsId<
|
||||
// If the message is one that immediately attempts to pay for execution, then
|
||||
// allow it.
|
||||
AllowTopLevelPaidExecutionFrom<Everything>,
|
||||
// Parent, its pluralities (i.e. governance bodies), relay treasury pezpallet and
|
||||
// BridgeHub get free execution.
|
||||
// Parent, its pluralities (i.e. governance bodies), relay treasury pezpallet
|
||||
// and BridgeHub get free execution.
|
||||
AllowExplicitUnpaidExecutionFrom<(
|
||||
ParentOrParentsPlurality,
|
||||
Equals<RelayTreasuryLocation>,
|
||||
|
||||
@@ -33,6 +33,7 @@ use asset_test_pezutils::{
|
||||
ExtBuilder, GovernanceOrigin, SlotDurations,
|
||||
};
|
||||
use codec::{Decode, Encode};
|
||||
use hex_literal::hex;
|
||||
use pezframe_support::{
|
||||
assert_noop, assert_ok, parameter_types,
|
||||
traits::{
|
||||
@@ -43,7 +44,6 @@ use pezframe_support::{
|
||||
},
|
||||
weights::{Weight, WeightToFee as WeightToFeeT},
|
||||
};
|
||||
use hex_literal::hex;
|
||||
use pezsp_consensus_aura::SlotDuration;
|
||||
use pezsp_core::crypto::Ss58Codec;
|
||||
use pezsp_runtime::traits::MaybeEquivalence;
|
||||
|
||||
@@ -21,11 +21,11 @@ extern crate alloc;
|
||||
|
||||
pub use bp_bridge_hub_pezcumulus::*;
|
||||
use bp_messages::*;
|
||||
pub use bp_xcm_bridge_hub_router::XcmBridgeHubRouterCall;
|
||||
use codec::{Decode, Encode};
|
||||
use pezbp_runtime::{
|
||||
decl_bridge_finality_runtime_apis, decl_bridge_messages_runtime_apis, Chain, ChainId, Teyrchain,
|
||||
};
|
||||
pub use bp_xcm_bridge_hub_router::XcmBridgeHubRouterCall;
|
||||
use codec::{Decode, Encode};
|
||||
use pezframe_support::{
|
||||
dispatch::DispatchClass,
|
||||
pezsp_runtime::{MultiAddress, MultiSigner, RuntimeDebug, StateVersion},
|
||||
|
||||
+1
-1
@@ -20,9 +20,9 @@ use crate::{
|
||||
*,
|
||||
};
|
||||
use alloc::{vec, vec::Vec};
|
||||
use hex_literal::hex;
|
||||
use pezcumulus_primitives_core::ParaId;
|
||||
use pezframe_support::build_struct_json_patch;
|
||||
use hex_literal::hex;
|
||||
use pezsp_core::crypto::UncheckedInto;
|
||||
use pezsp_genesis_builder::PresetId;
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
|
||||
@@ -23,11 +23,11 @@ use pezframe_support::{
|
||||
traits::{tokens::UnityOrOuterConversion, EitherOf, EitherOfDiverse, FromContains},
|
||||
};
|
||||
use pezframe_system::EnsureRootWithSuccess;
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
use pezkuwi_runtime_common::{
|
||||
impls::{ContainsParts, VersionedLocatableAsset},
|
||||
prod_or_fast,
|
||||
};
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
use pezsp_runtime::{traits::IdentityLookup, Percent};
|
||||
use teyrchains_common::pay::{LocalPay, VersionedLocatableAccount};
|
||||
use xcm::latest::BodyId;
|
||||
|
||||
@@ -36,7 +36,9 @@ pub mod governance;
|
||||
mod migrations;
|
||||
mod staking;
|
||||
|
||||
use governance::{pezpallet_custom_origins, FellowshipAdmin, GeneralAdmin, StakingAdmin, Treasurer};
|
||||
use governance::{
|
||||
pezpallet_custom_origins, FellowshipAdmin, GeneralAdmin, StakingAdmin, Treasurer,
|
||||
};
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
@@ -48,7 +50,9 @@ use assets_common::{
|
||||
};
|
||||
use bp_asset_hub_zagros::CreateForeignAssetDeposit;
|
||||
use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
|
||||
use pezcumulus_pezpallet_teyrchain_system::{RelayNumberMonotonicallyIncreases, RelaychainDataProvider};
|
||||
use pezcumulus_pezpallet_teyrchain_system::{
|
||||
RelayNumberMonotonicallyIncreases, RelaychainDataProvider,
|
||||
};
|
||||
use pezcumulus_primitives_core::{relay_chain::AccountIndex, AggregateMessageOrigin, ParaId};
|
||||
use pezframe_support::{
|
||||
construct_runtime, derive_impl,
|
||||
@@ -783,8 +787,9 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
|
||||
RuntimeCall::Uniques(pezpallet_uniques::Call::set_collection_metadata { .. }) |
|
||||
RuntimeCall::Uniques(pezpallet_uniques::Call::clear_metadata { .. }) |
|
||||
RuntimeCall::Uniques(pezpallet_uniques::Call::clear_attribute { .. }) |
|
||||
RuntimeCall::Uniques(pezpallet_uniques::Call::clear_collection_metadata { .. }) |
|
||||
RuntimeCall::Uniques(pezpallet_uniques::Call::set_collection_max_supply { .. }) |
|
||||
RuntimeCall::Uniques(
|
||||
pezpallet_uniques::Call::clear_collection_metadata { .. }
|
||||
) | RuntimeCall::Uniques(pezpallet_uniques::Call::set_collection_max_supply { .. }) |
|
||||
RuntimeCall::Utility { .. } |
|
||||
RuntimeCall::Multisig { .. }
|
||||
),
|
||||
@@ -1521,7 +1526,8 @@ impl pezframe_support::traits::OnRuntimeUpgrade for DeleteUndecodableStorage {
|
||||
},
|
||||
Err(e) => {
|
||||
tracing::error!(target: "bridges::on_runtime_upgrade", error=?e, "Failed to destroy undecodable NFT item");
|
||||
return <Runtime as pezframe_system::Config>::DbWeight::get().reads_writes(0, writes);
|
||||
return <Runtime as pezframe_system::Config>::DbWeight::get()
|
||||
.reads_writes(0, writes);
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1533,7 +1539,8 @@ impl pezframe_support::traits::OnRuntimeUpgrade for DeleteUndecodableStorage {
|
||||
},
|
||||
Err(e) => {
|
||||
tracing::error!(target: "bridges::on_runtime_upgrade", error=?e, "Failed to destroy undecodable NFT item");
|
||||
return <Runtime as pezframe_system::Config>::DbWeight::get().reads_writes(0, writes);
|
||||
return <Runtime as pezframe_system::Config>::DbWeight::get()
|
||||
.reads_writes(0, writes);
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -18,10 +18,10 @@ use super::*;
|
||||
use pezcumulus_primitives_core::relay_chain::SessionIndex;
|
||||
use pezframe_election_provider_support::{ElectionDataProvider, SequentialPhragmen};
|
||||
use pezframe_support::traits::EitherOf;
|
||||
use pezkuwi_runtime_common::{prod_or_fast, BalanceToU256, U256ToBalance};
|
||||
use pezpallet_election_provider_multi_block::{self as multi_block, SolutionAccuracyOf};
|
||||
use pezpallet_staking_async::UseValidatorsMap;
|
||||
use pezpallet_staking_async_rc_client as rc_client;
|
||||
use pezkuwi_runtime_common::{prod_or_fast, BalanceToU256, U256ToBalance};
|
||||
use pezsp_runtime::{
|
||||
transaction_validity::TransactionPriority, FixedPointNumber, FixedU128, SaturatedConversion,
|
||||
};
|
||||
@@ -140,7 +140,8 @@ impl multi_block::verifier::Config for Runtime {
|
||||
type MaxBackersPerWinner = MaxBackersPerWinner;
|
||||
type MaxBackersPerWinnerFinal = MaxBackersPerWinnerFinal;
|
||||
type SolutionDataProvider = MultiBlockElectionSigned;
|
||||
type WeightInfo = weights::pezpallet_election_provider_multi_block_verifier::WeightInfo<Runtime>;
|
||||
type WeightInfo =
|
||||
weights::pezpallet_election_provider_multi_block_verifier::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -179,7 +180,8 @@ impl multi_block::unsigned::Config for Runtime {
|
||||
type OffchainSolver = SequentialPhragmen<AccountId, SolutionAccuracyOf<Runtime>>;
|
||||
type MinerTxPriority = MinerTxPriority;
|
||||
type OffchainRepeat = OffchainRepeat;
|
||||
type WeightInfo = weights::pezpallet_election_provider_multi_block_unsigned::WeightInfo<Runtime>;
|
||||
type WeightInfo =
|
||||
weights::pezpallet_election_provider_multi_block_unsigned::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -289,7 +291,8 @@ impl pezpallet_staking_async::Config for Runtime {
|
||||
type VoterList = VoterList;
|
||||
type TargetList = UseValidatorsMap<Self>;
|
||||
type MaxValidatorSet = MaxValidatorSet;
|
||||
type NominationsQuota = pezpallet_staking_async::FixedNominationsQuota<{ MaxNominations::get() }>;
|
||||
type NominationsQuota =
|
||||
pezpallet_staking_async::FixedNominationsQuota<{ MaxNominations::get() }>;
|
||||
type MaxUnlockingChunks = pezframe_support::traits::ConstU32<32>;
|
||||
type HistoryDepth = pezframe_support::traits::ConstU32<84>;
|
||||
type MaxControllersInDeprecationBatch = MaxControllersInDeprecationBatch;
|
||||
|
||||
@@ -14,13 +14,14 @@
|
||||
// limitations under the License.
|
||||
|
||||
pub mod block_weights;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod inmemorydb_weights;
|
||||
pub mod paritydb_weights;
|
||||
pub mod pezcumulus_pezpallet_teyrchain_system;
|
||||
pub mod pezcumulus_pezpallet_weight_reclaim;
|
||||
pub mod pezcumulus_pezpallet_xcmp_queue;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod pezframe_system;
|
||||
pub mod pezframe_system_extensions;
|
||||
pub mod inmemorydb_weights;
|
||||
pub mod pezpallet_ah_ops;
|
||||
pub mod pezpallet_asset_conversion;
|
||||
pub mod pezpallet_asset_conversion_ops;
|
||||
@@ -61,10 +62,9 @@ pub mod pezpallet_vesting;
|
||||
pub mod pezpallet_whitelist;
|
||||
pub mod pezpallet_xcm;
|
||||
pub mod pezpallet_xcm_bridge_hub_router;
|
||||
pub mod paritydb_weights;
|
||||
pub mod rocksdb_weights;
|
||||
pub mod pezsnowbridge_pezpallet_system_backend;
|
||||
pub mod pezsnowbridge_pezpallet_system_frontend;
|
||||
pub mod rocksdb_weights;
|
||||
pub mod xcm;
|
||||
|
||||
pub use block_weights::constants::BlockExecutionWeight;
|
||||
|
||||
@@ -38,9 +38,9 @@ use pezframe_support::{
|
||||
PalletId,
|
||||
};
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough};
|
||||
use pezkuwi_runtime_common::xcm_sender::ExponentialPrice;
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough};
|
||||
use pezsnowbridge_outbound_queue_primitives::v2::exporter::PausableExporter;
|
||||
use pezsp_runtime::traits::{AccountIdConversion, TryConvertInto};
|
||||
use testnet_teyrchains_constants::zagros::locations::AssetHubParaId;
|
||||
@@ -325,8 +325,8 @@ pub type Barrier = TrailingSetTopicAsId<
|
||||
// If the message is one that immediately attempts to pay for execution, then
|
||||
// allow it.
|
||||
AllowTopLevelPaidExecutionFrom<Everything>,
|
||||
// Parent, its pluralities (i.e. governance bodies), relay treasury pezpallet and
|
||||
// sibling teyrchains get free execution.
|
||||
// Parent, its pluralities (i.e. governance bodies), relay treasury pezpallet
|
||||
// and sibling teyrchains get free execution.
|
||||
AllowExplicitUnpaidExecutionFrom<(
|
||||
ParentOrParentsPlurality,
|
||||
Equals<RelayTreasuryLocation>,
|
||||
|
||||
@@ -40,6 +40,7 @@ use asset_test_pezutils::{
|
||||
};
|
||||
use assets_common::local_and_foreign_assets::ForeignAssetReserveData;
|
||||
use codec::{Decode, Encode};
|
||||
use hex_literal::hex;
|
||||
use pezframe_support::{
|
||||
assert_err, assert_noop, assert_ok, parameter_types,
|
||||
traits::{
|
||||
@@ -55,7 +56,6 @@ use pezframe_support::{
|
||||
},
|
||||
weights::{Weight, WeightToFee as WeightToFeeT},
|
||||
};
|
||||
use hex_literal::hex;
|
||||
use pezpallet_revive::{
|
||||
test_utils::builder::{BareInstantiateBuilder, Contract},
|
||||
Code,
|
||||
@@ -89,8 +89,9 @@ const SOME_ASSET_ADMIN: [u8; 32] = [5u8; 32];
|
||||
const ERC20_PVM: &[u8] =
|
||||
include_bytes!("../../../../../../bizinikiwi/pezframe/revive/fixtures/erc20/erc20.polkavm");
|
||||
|
||||
const FAKE_ERC20_PVM: &[u8] =
|
||||
include_bytes!("../../../../../../bizinikiwi/pezframe/revive/fixtures/erc20/fake_erc20.polkavm");
|
||||
const FAKE_ERC20_PVM: &[u8] = include_bytes!(
|
||||
"../../../../../../bizinikiwi/pezframe/revive/fixtures/erc20/fake_erc20.polkavm"
|
||||
);
|
||||
|
||||
const EXPENSIVE_ERC20_PVM: &[u8] = include_bytes!(
|
||||
"../../../../../../bizinikiwi/pezframe/revive/fixtures/erc20/expensive_erc20.polkavm"
|
||||
|
||||
@@ -38,7 +38,8 @@ pub struct AssetPairFactory<Target, SelfParaId, PalletId, L = Location>(
|
||||
PhantomData<(Target, SelfParaId, PalletId, L)>,
|
||||
);
|
||||
impl<Target: Get<L>, SelfParaId: Get<ParaId>, PalletId: Get<u32>, L: TryFrom<Location> + Debug>
|
||||
pezpallet_asset_conversion::BenchmarkHelper<L> for AssetPairFactory<Target, SelfParaId, PalletId, L>
|
||||
pezpallet_asset_conversion::BenchmarkHelper<L>
|
||||
for AssetPairFactory<Target, SelfParaId, PalletId, L>
|
||||
where
|
||||
<L as TryFrom<Location>>::Error: Debug,
|
||||
{
|
||||
|
||||
@@ -137,7 +137,10 @@ where
|
||||
}
|
||||
|
||||
/// Helper function to convert `Balance` with Location` to `Asset`
|
||||
pub fn convert_balance<T: pezframe_support::pezpallet_prelude::Get<Location>, Balance: TryInto<u128>>(
|
||||
pub fn convert_balance<
|
||||
T: pezframe_support::pezpallet_prelude::Get<Location>,
|
||||
Balance: TryInto<u128>,
|
||||
>(
|
||||
balance: Balance,
|
||||
) -> Result<Asset, FungiblesAccessError> {
|
||||
match balance.try_into() {
|
||||
|
||||
@@ -74,8 +74,8 @@ pub type TrustBackedAssetsConvertedConcreteId<
|
||||
pub type UniquesConvertedConcreteId<UniquesPalletLocation> = MatchedConvertedConcreteId<
|
||||
CollectionId,
|
||||
ItemId,
|
||||
// The asset starts with the uniques pezpallet. The `CollectionId` of the asset is specified as a
|
||||
// junction within the pezpallet itself.
|
||||
// The asset starts with the uniques pezpallet. The `CollectionId` of the asset is specified as
|
||||
// a junction within the pezpallet itself.
|
||||
StartsWith<UniquesPalletLocation>,
|
||||
CollectionIdForUniquesConvert<UniquesPalletLocation>,
|
||||
TryConvertInto,
|
||||
@@ -175,8 +175,8 @@ pub type PoolAssetsConvertedConcreteId<PoolAssetsPalletLocation, Balance> =
|
||||
TryConvertInto,
|
||||
>;
|
||||
|
||||
/// Adapter implementation for accessing pools (`pezpallet_asset_conversion`) that uses `AssetKind` as
|
||||
/// a `xcm::v*` which could be different from the `xcm::latest`.
|
||||
/// Adapter implementation for accessing pools (`pezpallet_asset_conversion`) that uses `AssetKind`
|
||||
/// as a `xcm::v*` which could be different from the `xcm::latest`.
|
||||
pub struct PoolAdapter<Runtime>(PhantomData<Runtime>);
|
||||
impl<
|
||||
Runtime: pezpallet_asset_conversion::Config<PoolId = (L, L), AssetKind = L>,
|
||||
@@ -230,15 +230,17 @@ impl<
|
||||
|
||||
/// Helper function for filtering pool.
|
||||
pub fn iter_assets_in_pool_with(asset: &L) -> impl Iterator<Item = L> + '_ {
|
||||
pezpallet_asset_conversion::Pools::<Runtime>::iter_keys().filter_map(|(asset_1, asset_2)| {
|
||||
if asset_1 == *asset {
|
||||
Some(asset_2)
|
||||
} else if asset_2 == *asset {
|
||||
Some(asset_1)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
pezpallet_asset_conversion::Pools::<Runtime>::iter_keys().filter_map(
|
||||
|(asset_1, asset_2)| {
|
||||
if asset_1 == *asset {
|
||||
Some(asset_2)
|
||||
} else if asset_2 == *asset {
|
||||
Some(asset_1)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -883,7 +883,8 @@ pub fn asset_transactor_transfer_with_pallet_assets_instance_works<
|
||||
From<AssetId> + Into<AssetId>,
|
||||
<Runtime as pezpallet_assets::Config<AssetsPalletInstance>>::AssetIdParameter:
|
||||
From<AssetId> + Into<AssetId>,
|
||||
<Runtime as pezpallet_assets::Config<AssetsPalletInstance>>::Balance: From<Balance> + Into<u128>,
|
||||
<Runtime as pezpallet_assets::Config<AssetsPalletInstance>>::Balance:
|
||||
From<Balance> + Into<u128>,
|
||||
<Runtime as pezframe_system::Config>::AccountId:
|
||||
Into<<<Runtime as pezframe_system::Config>::RuntimeOrigin as OriginTrait>::AccountId>,
|
||||
<<Runtime as pezframe_system::Config>::Lookup as StaticLookup>::Source:
|
||||
@@ -1199,11 +1200,15 @@ pub fn create_and_manage_foreign_assets_for_local_consensus_teyrchain_assets_wor
|
||||
.with_tracing()
|
||||
.build()
|
||||
.execute_with(|| {
|
||||
assert!(<pezpallet_assets::Pezpallet<Runtime, ForeignAssetsPalletInstance>>::asset_ids()
|
||||
.collect::<Vec<_>>()
|
||||
.is_empty());
|
||||
assert!(
|
||||
<pezpallet_assets::Pezpallet<Runtime, ForeignAssetsPalletInstance>>::asset_ids()
|
||||
.collect::<Vec<_>>()
|
||||
.is_empty()
|
||||
);
|
||||
assert_eq!(
|
||||
<pezpallet_balances::Pezpallet<Runtime>>::free_balance(&foreign_creator_as_account_id),
|
||||
<pezpallet_balances::Pezpallet<Runtime>>::free_balance(
|
||||
&foreign_creator_as_account_id
|
||||
),
|
||||
existential_deposit +
|
||||
asset_deposit + metadata_deposit_base +
|
||||
metadata_deposit_per_byte_eta +
|
||||
@@ -1289,9 +1294,11 @@ pub fn create_and_manage_foreign_assets_for_local_consensus_teyrchain_assets_wor
|
||||
assert!(events.any(|e| matches!(e, pezpallet_assets::Event::TeamChanged { .. })));
|
||||
|
||||
// check assets after
|
||||
assert!(!<pezpallet_assets::Pezpallet<Runtime, ForeignAssetsPalletInstance>>::asset_ids()
|
||||
.collect::<Vec<_>>()
|
||||
.is_empty());
|
||||
assert!(
|
||||
!<pezpallet_assets::Pezpallet<Runtime, ForeignAssetsPalletInstance>>::asset_ids()
|
||||
.collect::<Vec<_>>()
|
||||
.is_empty()
|
||||
);
|
||||
|
||||
// check update metadata
|
||||
use pezframe_support::traits::fungibles::roles::Inspect as InspectRoles;
|
||||
@@ -1320,10 +1327,13 @@ pub fn create_and_manage_foreign_assets_for_local_consensus_teyrchain_assets_wor
|
||||
Some(bob_account.clone())
|
||||
);
|
||||
assert!(
|
||||
<pezpallet_balances::Pezpallet<Runtime>>::free_balance(&foreign_creator_as_account_id) >=
|
||||
existential_deposit + buy_execution_fee_amount.into(),
|
||||
<pezpallet_balances::Pezpallet<Runtime>>::free_balance(
|
||||
&foreign_creator_as_account_id
|
||||
) >= existential_deposit + buy_execution_fee_amount.into(),
|
||||
"Free balance: {:?} should be ge {:?}",
|
||||
<pezpallet_balances::Pezpallet<Runtime>>::free_balance(&foreign_creator_as_account_id),
|
||||
<pezpallet_balances::Pezpallet<Runtime>>::free_balance(
|
||||
&foreign_creator_as_account_id
|
||||
),
|
||||
existential_deposit + buy_execution_fee_amount.into()
|
||||
);
|
||||
assert_metadata::<
|
||||
@@ -1701,9 +1711,10 @@ where
|
||||
assert_eq!(execution_fees, expected_weight_native_fee);
|
||||
|
||||
// We need some balance to create an asset.
|
||||
assert_ok!(
|
||||
pezpallet_balances::Pezpallet::<Runtime>::mint_into(&test_account, 3_000_000_000_000,)
|
||||
);
|
||||
assert_ok!(pezpallet_balances::Pezpallet::<Runtime>::mint_into(
|
||||
&test_account,
|
||||
3_000_000_000_000,
|
||||
));
|
||||
|
||||
// Now we try to use an asset that's not in a pool.
|
||||
let asset_id = 1984u32; // USDT.
|
||||
|
||||
+1
-1
@@ -21,10 +21,10 @@
|
||||
|
||||
pub use bp_bridge_hub_pezcumulus::*;
|
||||
use bp_messages::*;
|
||||
use codec::{Decode, Encode};
|
||||
use pezbp_runtime::{
|
||||
decl_bridge_finality_runtime_apis, decl_bridge_messages_runtime_apis, Chain, ChainId, Teyrchain,
|
||||
};
|
||||
use codec::{Decode, Encode};
|
||||
use pezframe_support::{
|
||||
dispatch::DispatchClass,
|
||||
pezsp_runtime::{MultiAddress, MultiSigner, RuntimeDebug, StateVersion},
|
||||
|
||||
+4
-2
@@ -35,12 +35,12 @@ use pezframe_support::{
|
||||
traits::{Equals, PalletInfoAccess},
|
||||
};
|
||||
use pezframe_system::{EnsureNever, EnsureRoot};
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use pezpallet_bridge_messages::LaneIdOf;
|
||||
use pezpallet_bridge_relayers::extension::{
|
||||
BridgeRelayersTransactionExtension, WithMessagesExtensionConfig,
|
||||
};
|
||||
use pezpallet_xcm_bridge_hub::XcmAsPlainPayload;
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use testnet_teyrchains_constants::pezkuwichain::currency::UNITS as TYR;
|
||||
use xcm::{
|
||||
latest::prelude::*,
|
||||
@@ -115,7 +115,9 @@ pub type WithPezkuwichainBulletinMessagesInstance = pezpallet_bridge_messages::I
|
||||
impl pezpallet_bridge_messages::Config<WithPezkuwichainBulletinMessagesInstance> for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type WeightInfo =
|
||||
weights::pezpallet_bridge_messages_pezkuwichain_to_pezkuwichain_bulletin::WeightInfo<Runtime>;
|
||||
weights::pezpallet_bridge_messages_pezkuwichain_to_pezkuwichain_bulletin::WeightInfo<
|
||||
Runtime,
|
||||
>;
|
||||
|
||||
type ThisChain = bp_bridge_hub_pezkuwichain::BridgeHubPezkuwichain;
|
||||
type BridgedChain = bp_pezkuwi_bulletin::PezkuwiBulletin;
|
||||
|
||||
+3
-2
@@ -38,8 +38,8 @@ use crate::xcm_config::RelayNetwork;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
use benchmark_helpers::DoNothingRouter;
|
||||
use bp_asset_hub_pezkuwichain::CreateForeignAssetDeposit;
|
||||
use pezframe_support::{parameter_types, weights::ConstantMultiplier};
|
||||
use hex_literal::hex;
|
||||
use pezframe_support::{parameter_types, weights::ConstantMultiplier};
|
||||
use pezpallet_xcm::EnsureXcm;
|
||||
use pezsp_runtime::{
|
||||
traits::{ConstU32, ConstU8, Keccak256},
|
||||
@@ -186,7 +186,8 @@ parameter_types! {
|
||||
};
|
||||
}
|
||||
|
||||
pub const SLOTS_PER_EPOCH: u32 = pezsnowbridge_pezpallet_ethereum_client::config::SLOTS_PER_EPOCH as u32;
|
||||
pub const SLOTS_PER_EPOCH: u32 =
|
||||
pezsnowbridge_pezpallet_ethereum_client::config::SLOTS_PER_EPOCH as u32;
|
||||
|
||||
impl pezsnowbridge_pezpallet_ethereum_client::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
|
||||
+13
-11
@@ -35,11 +35,11 @@ use pezpallet_xcm_bridge_hub::{BridgeId, XcmAsPlainPayload};
|
||||
|
||||
use pezframe_support::{parameter_types, traits::PalletInfoAccess};
|
||||
use pezframe_system::{EnsureNever, EnsureRoot};
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use pezpallet_bridge_messages::LaneIdOf;
|
||||
use pezpallet_bridge_relayers::extension::{
|
||||
BridgeRelayersTransactionExtension, WithMessagesExtensionConfig,
|
||||
};
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use testnet_teyrchains_constants::pezkuwichain::currency::UNITS as TYR;
|
||||
use teyrchains_common::xcm_config::{AllSiblingSystemTeyrchains, RelayOrOtherSystemTeyrchains};
|
||||
use xcm::{
|
||||
@@ -105,7 +105,8 @@ pezbp_runtime::generate_static_str_provider!(OnBridgeHubPezkuwichainRefundBridge
|
||||
pub type WithBridgeHubZagrosMessagesInstance = pezpallet_bridge_messages::Instance3;
|
||||
impl pezpallet_bridge_messages::Config<WithBridgeHubZagrosMessagesInstance> for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type WeightInfo = weights::pezpallet_bridge_messages_pezkuwichain_to_zagros::WeightInfo<Runtime>;
|
||||
type WeightInfo =
|
||||
weights::pezpallet_bridge_messages_pezkuwichain_to_zagros::WeightInfo<Runtime>;
|
||||
|
||||
type ThisChain = bp_bridge_hub_pezkuwichain::BridgeHubPezkuwichain;
|
||||
type BridgedChain = bp_bridge_hub_zagros::BridgeHubZagros;
|
||||
@@ -120,12 +121,13 @@ impl pezpallet_bridge_messages::Config<WithBridgeHubZagrosMessagesInstance> for
|
||||
type LaneId = LegacyLaneId;
|
||||
|
||||
type DeliveryPayments = ();
|
||||
type DeliveryConfirmationPayments = pezpallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter<
|
||||
Runtime,
|
||||
WithBridgeHubZagrosMessagesInstance,
|
||||
RelayersForLegacyLaneIdsMessagesInstance,
|
||||
DeliveryRewardInBalance,
|
||||
>;
|
||||
type DeliveryConfirmationPayments =
|
||||
pezpallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter<
|
||||
Runtime,
|
||||
WithBridgeHubZagrosMessagesInstance,
|
||||
RelayersForLegacyLaneIdsMessagesInstance,
|
||||
DeliveryRewardInBalance,
|
||||
>;
|
||||
|
||||
type MessageDispatch = XcmOverBridgeHubZagros;
|
||||
type OnMessagesDelivered = XcmOverBridgeHubZagros;
|
||||
@@ -363,8 +365,8 @@ pub mod migration {
|
||||
|
||||
mod v1_wrong {
|
||||
use bp_messages::{LaneState, MessageNonce, UnrewardedRelayer};
|
||||
use pezbp_runtime::AccountIdOf;
|
||||
use codec::{Decode, Encode};
|
||||
use pezbp_runtime::AccountIdOf;
|
||||
use pezpallet_bridge_messages::BridgedChainOf;
|
||||
use pezsp_std::collections::vec_deque::VecDeque;
|
||||
|
||||
@@ -396,8 +398,8 @@ pub mod migration {
|
||||
/// for Pezkuwichain/Zagros).
|
||||
pub struct FixMessagesV1Migration<T, I>(pezsp_std::marker::PhantomData<(T, I)>);
|
||||
|
||||
impl<T: pezpallet_bridge_messages::Config<I>, I: 'static> pezframe_support::traits::OnRuntimeUpgrade
|
||||
for FixMessagesV1Migration<T, I>
|
||||
impl<T: pezpallet_bridge_messages::Config<I>, I: 'static>
|
||||
pezframe_support::traits::OnRuntimeUpgrade for FixMessagesV1Migration<T, I>
|
||||
{
|
||||
fn on_runtime_upgrade() -> Weight {
|
||||
use pezsp_core::Get;
|
||||
|
||||
@@ -75,11 +75,11 @@ use testnet_teyrchains_constants::pezkuwichain::{
|
||||
consensus::*, currency::*, fee::WeightToFee, time::*,
|
||||
};
|
||||
|
||||
use pezbp_runtime::HeaderId;
|
||||
use bridge_hub_common::{
|
||||
message_queue::{NarrowOriginToSibling, ParaIdToSibling},
|
||||
AggregateMessageOrigin,
|
||||
};
|
||||
use pezbp_runtime::HeaderId;
|
||||
pub use pezsp_consensus_aura::sr25519::AuthorityId as AuraId;
|
||||
pub use pezsp_runtime::{MultiAddress, Perbill, Permill};
|
||||
|
||||
@@ -501,7 +501,8 @@ impl pezpallet_session::Config for Runtime {
|
||||
// we don't have stash and controller, thus we don't need the convert as well.
|
||||
type ValidatorIdOf = pezpallet_collator_selection::IdentityCollator;
|
||||
type ShouldEndSession = pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type NextSessionRotation = pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type NextSessionRotation =
|
||||
pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type SessionManager = CollatorSelection;
|
||||
// Essentially just Aura, but let's be pedantic.
|
||||
type SessionHandler = <SessionKeys as pezsp_runtime::traits::OpaqueKeys>::KeyTypeIdProviders;
|
||||
|
||||
+3
-3
@@ -23,10 +23,11 @@ use ::pezpallet_bridge_relayers::WeightInfo as _;
|
||||
use ::pezpallet_bridge_teyrchains::WeightInfoExt as TeyrchainsWeightInfoExt;
|
||||
|
||||
pub mod block_weights;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod paritydb_weights;
|
||||
pub mod pezcumulus_pezpallet_teyrchain_system;
|
||||
pub mod pezcumulus_pezpallet_weight_reclaim;
|
||||
pub mod pezcumulus_pezpallet_xcmp_queue;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod pezframe_system;
|
||||
pub mod pezframe_system_extensions;
|
||||
pub mod pezpallet_balances;
|
||||
@@ -44,12 +45,11 @@ pub mod pezpallet_timestamp;
|
||||
pub mod pezpallet_transaction_payment;
|
||||
pub mod pezpallet_utility;
|
||||
pub mod pezpallet_xcm;
|
||||
pub mod paritydb_weights;
|
||||
pub mod rocksdb_weights;
|
||||
pub mod pezsnowbridge_pezpallet_ethereum_client;
|
||||
pub mod pezsnowbridge_pezpallet_inbound_queue;
|
||||
pub mod pezsnowbridge_pezpallet_outbound_queue;
|
||||
pub mod pezsnowbridge_pezpallet_system;
|
||||
pub mod rocksdb_weights;
|
||||
pub mod xcm;
|
||||
|
||||
pub use block_weights::constants::BlockExecutionWeight;
|
||||
|
||||
+2
-2
@@ -30,10 +30,10 @@ use pezframe_support::{
|
||||
},
|
||||
};
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezpallet_collator_selection::StakingPotAccountId;
|
||||
use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough};
|
||||
use pezkuwi_runtime_common::xcm_sender::ExponentialPrice;
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use pezpallet_collator_selection::StakingPotAccountId;
|
||||
use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough};
|
||||
use pezsp_runtime::traits::AccountIdConversion;
|
||||
use testnet_teyrchains_constants::pezkuwichain::snowbridge::EthereumNetwork;
|
||||
use teyrchains_common::{
|
||||
|
||||
+6
-5
@@ -17,13 +17,13 @@
|
||||
#![cfg(test)]
|
||||
|
||||
use bp_pezkuwi_core::Signature;
|
||||
use codec::{Decode, Encode};
|
||||
use pezbridge_hub_pezkuwichain_runtime::{
|
||||
bridge_to_zagros_config::OnBridgeHubPezkuwichainRefundBridgeHubZagrosMessages,
|
||||
xcm_config::XcmConfig, AllPalletsWithoutSystem, BridgeRejectObsoleteHeadersAndMessages,
|
||||
Executive, MessageQueueServiceWeight, Runtime, RuntimeCall, RuntimeEvent, SessionKeys,
|
||||
TxExtension, UncheckedExtrinsic,
|
||||
};
|
||||
use codec::{Decode, Encode};
|
||||
use pezcumulus_primitives_core::XcmError::FailedToTransactAsset;
|
||||
use pezframe_support::parameter_types;
|
||||
use pezsnowbridge_pezpallet_ethereum_client::WeightInfo;
|
||||
@@ -97,7 +97,8 @@ pub fn transfer_token_to_ethereum_insufficient_fund() {
|
||||
fn max_message_queue_service_weight_is_more_than_beacon_extrinsic_weights() {
|
||||
let max_message_queue_weight = MessageQueueServiceWeight::get();
|
||||
let force_checkpoint =
|
||||
<Runtime as pezsnowbridge_pezpallet_ethereum_client::Config>::WeightInfo::force_checkpoint();
|
||||
<Runtime as pezsnowbridge_pezpallet_ethereum_client::Config>::WeightInfo::force_checkpoint(
|
||||
);
|
||||
let submit_checkpoint =
|
||||
<Runtime as pezsnowbridge_pezpallet_ethereum_client::Config>::WeightInfo::submit();
|
||||
max_message_queue_weight.all_gt(force_checkpoint);
|
||||
@@ -123,9 +124,9 @@ fn ethereum_to_pezkuwi_message_extrinsics_work() {
|
||||
}
|
||||
|
||||
/// Tests that the digest items are as expected when a Ethereum Outbound message is received.
|
||||
/// If the MessageQueue pezpallet is configured before (i.e. the MessageQueue pezpallet is listed before
|
||||
/// the EthereumOutboundQueue in the construct_runtime macro) the EthereumOutboundQueue, this test
|
||||
/// will fail.
|
||||
/// If the MessageQueue pezpallet is configured before (i.e. the MessageQueue pezpallet is listed
|
||||
/// before the EthereumOutboundQueue in the construct_runtime macro) the EthereumOutboundQueue, this
|
||||
/// test will fail.
|
||||
#[test]
|
||||
pub fn ethereum_outbound_queue_processes_messages_before_message_queue_works() {
|
||||
pezsnowbridge_runtime_test_common::ethereum_outbound_queue_processes_messages_before_message_queue_works::<
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#![cfg(test)]
|
||||
|
||||
use bp_pezkuwi_core::Signature;
|
||||
use codec::{Decode, Encode};
|
||||
use hex_literal::hex;
|
||||
use pezbridge_hub_pezkuwichain_runtime::{
|
||||
bridge_common_config, bridge_to_bulletin_config, bridge_to_zagros_config,
|
||||
xcm_config::{RelayNetwork, TokenLocation, XcmConfig},
|
||||
@@ -25,9 +27,7 @@ use pezbridge_hub_pezkuwichain_runtime::{
|
||||
TeyrchainSystem, TransactionPayment, TxExtension, UncheckedExtrinsic,
|
||||
};
|
||||
use pezbridge_hub_test_utils::{GovernanceOrigin, SlotDurations};
|
||||
use codec::{Decode, Encode};
|
||||
use pezframe_support::{dispatch::GetDispatchInfo, parameter_types, traits::ConstU8};
|
||||
use hex_literal::hex;
|
||||
use pezsnowbridge_core::ChannelId;
|
||||
use pezsp_consensus_aura::SlotDuration;
|
||||
use pezsp_core::{crypto::Ss58Codec, H160};
|
||||
@@ -131,14 +131,14 @@ mod bridge_hub_zagros_tests {
|
||||
BridgeGrandpaZagrosInstance, BridgeTeyrchainZagrosInstance, DeliveryRewardInBalance,
|
||||
RelayersForLegacyLaneIdsMessagesInstance,
|
||||
};
|
||||
use pezbridge_hub_pezkuwichain_runtime::{
|
||||
bridge_to_ethereum_config::EthereumGatewayAddress, xcm_config::LocationToAccountId,
|
||||
};
|
||||
use pezbridge_hub_test_utils::test_cases::from_teyrchain;
|
||||
use bridge_to_zagros_config::{
|
||||
BridgeHubZagrosLocation, WithBridgeHubZagrosMessagesInstance,
|
||||
XcmOverBridgeHubZagrosInstance, ZagrosGlobalConsensusNetwork,
|
||||
};
|
||||
use pezbridge_hub_pezkuwichain_runtime::{
|
||||
bridge_to_ethereum_config::EthereumGatewayAddress, xcm_config::LocationToAccountId,
|
||||
};
|
||||
use pezbridge_hub_test_utils::test_cases::from_teyrchain;
|
||||
use pezcumulus_primitives_core::UpwardMessageSender;
|
||||
|
||||
// Random para id of sibling chain used in tests.
|
||||
@@ -240,14 +240,20 @@ mod bridge_hub_zagros_tests {
|
||||
bp_bridge_hub_pezkuwichain::BRIDGE_HUB_PEZKUWICHAIN_TEYRCHAIN_ID,
|
||||
Governance::get(),
|
||||
vec![
|
||||
(pezsnowbridge_pezpallet_outbound_queue::Nonce::<Runtime>::hashed_key_for::<ChannelId>(
|
||||
channel_id_one,
|
||||
)
|
||||
.to_vec(), 0u64.encode()),
|
||||
(pezsnowbridge_pezpallet_inbound_queue::Nonce::<Runtime>::hashed_key_for::<ChannelId>(
|
||||
channel_id_one,
|
||||
)
|
||||
.to_vec(), 0u64.encode()),
|
||||
(
|
||||
pezsnowbridge_pezpallet_outbound_queue::Nonce::<Runtime>::hashed_key_for::<
|
||||
ChannelId,
|
||||
>(channel_id_one)
|
||||
.to_vec(),
|
||||
0u64.encode(),
|
||||
),
|
||||
(
|
||||
pezsnowbridge_pezpallet_inbound_queue::Nonce::<Runtime>::hashed_key_for::<
|
||||
ChannelId,
|
||||
>(channel_id_one)
|
||||
.to_vec(),
|
||||
0u64.encode(),
|
||||
),
|
||||
],
|
||||
|| {
|
||||
// Outbound
|
||||
@@ -521,16 +527,16 @@ mod bridge_hub_bulletin_tests {
|
||||
use super::*;
|
||||
use bp_messages::LegacyLaneId;
|
||||
use bridge_common_config::BridgeGrandpaPezkuwichainBulletinInstance;
|
||||
use pezbridge_hub_pezkuwichain_runtime::{
|
||||
bridge_common_config::RelayersForLegacyLaneIdsMessagesInstance,
|
||||
xcm_config::LocationToAccountId,
|
||||
};
|
||||
use pezbridge_hub_test_utils::test_cases::from_grandpa_chain;
|
||||
use bridge_to_bulletin_config::{
|
||||
PezkuwichainBulletinGlobalConsensusNetwork,
|
||||
PezkuwichainBulletinGlobalConsensusNetworkLocation,
|
||||
WithPezkuwichainBulletinMessagesInstance, XcmOverPezkuwiBulletinInstance,
|
||||
};
|
||||
use pezbridge_hub_pezkuwichain_runtime::{
|
||||
bridge_common_config::RelayersForLegacyLaneIdsMessagesInstance,
|
||||
xcm_config::LocationToAccountId,
|
||||
};
|
||||
use pezbridge_hub_test_utils::test_cases::from_grandpa_chain;
|
||||
use pezcumulus_primitives_core::UpwardMessageSender;
|
||||
|
||||
// Random para id of sibling chain used in tests.
|
||||
|
||||
+1
-1
@@ -20,10 +20,10 @@
|
||||
|
||||
pub use bp_bridge_hub_pezcumulus::*;
|
||||
use bp_messages::*;
|
||||
use codec::{Decode, Encode};
|
||||
use pezbp_runtime::{
|
||||
decl_bridge_finality_runtime_apis, decl_bridge_messages_runtime_apis, Chain, ChainId, Teyrchain,
|
||||
};
|
||||
use codec::{Decode, Encode};
|
||||
use pezframe_support::dispatch::DispatchClass;
|
||||
use pezsp_runtime::{RuntimeDebug, StateVersion};
|
||||
|
||||
|
||||
+18
-8
@@ -24,9 +24,9 @@ use crate::{
|
||||
};
|
||||
use bp_asset_hub_zagros::CreateForeignAssetDeposit;
|
||||
use bridge_hub_common::AggregateMessageOrigin;
|
||||
use hex_literal::hex;
|
||||
use pezframe_support::{parameter_types, traits::Contains, weights::ConstantMultiplier};
|
||||
use pezframe_system::EnsureRootWithSuccess;
|
||||
use hex_literal::hex;
|
||||
use pezpallet_xcm::EnsureXcm;
|
||||
use pezsnowbridge_beacon_primitives::{Fork, ForkVersions};
|
||||
use pezsnowbridge_core::{gwei, meth, AllowSiblingsOnly, PricingParameters, Rewards};
|
||||
@@ -53,7 +53,8 @@ use xcm::prelude::{GlobalConsensus, InteriorLocation, Location, PalletInstance,
|
||||
use xcm_executor::XcmExecutor;
|
||||
use zagros_runtime_constants::system_teyrchain::ASSET_HUB_ID;
|
||||
|
||||
pub const SLOTS_PER_EPOCH: u32 = pezsnowbridge_pezpallet_ethereum_client::config::SLOTS_PER_EPOCH as u32;
|
||||
pub const SLOTS_PER_EPOCH: u32 =
|
||||
pezsnowbridge_pezpallet_ethereum_client::config::SLOTS_PER_EPOCH as u32;
|
||||
|
||||
/// Exports message to the Ethereum Gateway contract.
|
||||
pub type SnowbridgeExporter = EthereumBlobExporter<
|
||||
@@ -194,7 +195,8 @@ impl pezsnowbridge_pezpallet_outbound_queue_v2::Config for Runtime {
|
||||
type WeightToFee = WeightToFee;
|
||||
type Verifier = EthereumBeaconClient;
|
||||
type GatewayAddress = EthereumGatewayAddress;
|
||||
type WeightInfo = crate::weights::pezsnowbridge_pezpallet_outbound_queue_v2::WeightInfo<Runtime>;
|
||||
type WeightInfo =
|
||||
crate::weights::pezsnowbridge_pezpallet_outbound_queue_v2::WeightInfo<Runtime>;
|
||||
type EthereumNetwork = EthereumNetwork;
|
||||
type RewardKind = BridgeReward;
|
||||
type DefaultRewardKind = SnowbridgeReward;
|
||||
@@ -325,8 +327,8 @@ pub mod benchmark_helpers {
|
||||
RuntimeOrigin, System,
|
||||
};
|
||||
use codec::Encode;
|
||||
use pezframe_support::assert_ok;
|
||||
use hex_literal::hex;
|
||||
use pezframe_support::assert_ok;
|
||||
use pezsnowbridge_beacon_primitives::BeaconHeader;
|
||||
use pezsnowbridge_inbound_queue_primitives::EventFixture;
|
||||
use pezsnowbridge_pezpallet_inbound_queue::BenchmarkHelper;
|
||||
@@ -357,7 +359,9 @@ pub mod benchmark_helpers {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: pezsnowbridge_pezpallet_inbound_queue_v2::Config> InboundQueueBenchmarkHelperV2<T> for Runtime {
|
||||
impl<T: pezsnowbridge_pezpallet_inbound_queue_v2::Config> InboundQueueBenchmarkHelperV2<T>
|
||||
for Runtime
|
||||
{
|
||||
fn initialize_storage() -> EventFixture {
|
||||
let message = make_register_token_message_v2();
|
||||
|
||||
@@ -370,7 +374,9 @@ pub mod benchmark_helpers {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: pezsnowbridge_pezpallet_outbound_queue_v2::Config> OutboundQueueBenchmarkHelperV2<T> for Runtime {
|
||||
impl<T: pezsnowbridge_pezpallet_outbound_queue_v2::Config> OutboundQueueBenchmarkHelperV2<T>
|
||||
for Runtime
|
||||
{
|
||||
fn initialize_storage(beacon_header: BeaconHeader, block_roots_root: H256) {
|
||||
EthereumBeaconClient::store_finalized_header(beacon_header, block_roots_root).unwrap();
|
||||
}
|
||||
@@ -440,7 +446,9 @@ pub(crate) mod migrations {
|
||||
>;
|
||||
|
||||
/// One shot migration for NetworkId::Zagros to NetworkId::ByGenesis(ZAGROS_GENESIS_HASH)
|
||||
pub struct MigrationForXcmV5<T: pezsnowbridge_pezpallet_system::Config>(core::marker::PhantomData<T>);
|
||||
pub struct MigrationForXcmV5<T: pezsnowbridge_pezpallet_system::Config>(
|
||||
core::marker::PhantomData<T>,
|
||||
);
|
||||
impl<T: pezsnowbridge_pezpallet_system::Config> pezframe_support::traits::OnRuntimeUpgrade
|
||||
for MigrationForXcmV5<T>
|
||||
{
|
||||
@@ -451,7 +459,9 @@ pub(crate) mod migrations {
|
||||
weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 1));
|
||||
Some(xcm::v5::Location::try_from(pre).expect("valid location"))
|
||||
};
|
||||
pezsnowbridge_pezpallet_system::ForeignToNativeId::<T>::translate_values(translate_zagros);
|
||||
pezsnowbridge_pezpallet_system::ForeignToNativeId::<T>::translate_values(
|
||||
translate_zagros,
|
||||
);
|
||||
|
||||
weight
|
||||
}
|
||||
|
||||
+11
-10
@@ -34,11 +34,11 @@ use pezframe_support::{
|
||||
traits::{ConstU32, PalletInfoAccess},
|
||||
};
|
||||
use pezframe_system::{EnsureNever, EnsureRoot};
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use pezpallet_bridge_messages::LaneIdOf;
|
||||
use pezpallet_bridge_relayers::extension::{
|
||||
BridgeRelayersTransactionExtension, WithMessagesExtensionConfig,
|
||||
};
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use testnet_teyrchains_constants::zagros::currency::UNITS as ZGR;
|
||||
use teyrchains_common::xcm_config::{AllSiblingSystemTeyrchains, RelayOrOtherSystemTeyrchains};
|
||||
use xcm::{
|
||||
@@ -151,12 +151,13 @@ impl pezpallet_bridge_messages::Config<WithBridgeHubPezkuwichainMessagesInstance
|
||||
type LaneId = LegacyLaneId;
|
||||
|
||||
type DeliveryPayments = ();
|
||||
type DeliveryConfirmationPayments = pezpallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter<
|
||||
Runtime,
|
||||
WithBridgeHubPezkuwichainMessagesInstance,
|
||||
BridgeRelayersInstance,
|
||||
DeliveryRewardInBalance,
|
||||
>;
|
||||
type DeliveryConfirmationPayments =
|
||||
pezpallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter<
|
||||
Runtime,
|
||||
WithBridgeHubPezkuwichainMessagesInstance,
|
||||
BridgeRelayersInstance,
|
||||
DeliveryRewardInBalance,
|
||||
>;
|
||||
|
||||
type MessageDispatch = XcmOverBridgeHubPezkuwichain;
|
||||
type OnMessagesDelivered = XcmOverBridgeHubPezkuwichain;
|
||||
@@ -381,8 +382,8 @@ pub mod migration {
|
||||
|
||||
mod v1_wrong {
|
||||
use bp_messages::{LaneState, MessageNonce, UnrewardedRelayer};
|
||||
use pezbp_runtime::AccountIdOf;
|
||||
use codec::{Decode, Encode};
|
||||
use pezbp_runtime::AccountIdOf;
|
||||
use pezpallet_bridge_messages::BridgedChainOf;
|
||||
use pezsp_std::collections::vec_deque::VecDeque;
|
||||
|
||||
@@ -414,8 +415,8 @@ pub mod migration {
|
||||
/// for Pezkuwichain/Zagros).
|
||||
pub struct FixMessagesV1Migration<T, I>(pezsp_std::marker::PhantomData<(T, I)>);
|
||||
|
||||
impl<T: pezpallet_bridge_messages::Config<I>, I: 'static> pezframe_support::traits::OnRuntimeUpgrade
|
||||
for FixMessagesV1Migration<T, I>
|
||||
impl<T: pezpallet_bridge_messages::Config<I>, I: 'static>
|
||||
pezframe_support::traits::OnRuntimeUpgrade for FixMessagesV1Migration<T, I>
|
||||
{
|
||||
fn on_runtime_upgrade() -> Weight {
|
||||
use pezsp_core::Get;
|
||||
|
||||
@@ -485,7 +485,8 @@ impl pezpallet_session::Config for Runtime {
|
||||
// we don't have stash and controller, thus we don't need the convert as well.
|
||||
type ValidatorIdOf = pezpallet_collator_selection::IdentityCollator;
|
||||
type ShouldEndSession = pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type NextSessionRotation = pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type NextSessionRotation =
|
||||
pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type SessionManager = CollatorSelection;
|
||||
// Essentially just Aura, but let's be pedantic.
|
||||
type SessionHandler = <SessionKeys as pezsp_runtime::traits::OpaqueKeys>::KeyTypeIdProviders;
|
||||
|
||||
@@ -23,10 +23,11 @@ use ::pezpallet_bridge_relayers::WeightInfo as _;
|
||||
use ::pezpallet_bridge_teyrchains::WeightInfoExt as TeyrchainsWeightInfoExt;
|
||||
|
||||
pub mod block_weights;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod paritydb_weights;
|
||||
pub mod pezcumulus_pezpallet_teyrchain_system;
|
||||
pub mod pezcumulus_pezpallet_weight_reclaim;
|
||||
pub mod pezcumulus_pezpallet_xcmp_queue;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod pezframe_system;
|
||||
pub mod pezframe_system_extensions;
|
||||
pub mod pezpallet_balances;
|
||||
@@ -42,7 +43,6 @@ pub mod pezpallet_timestamp;
|
||||
pub mod pezpallet_transaction_payment;
|
||||
pub mod pezpallet_utility;
|
||||
pub mod pezpallet_xcm;
|
||||
pub mod paritydb_weights;
|
||||
pub mod rocksdb_weights;
|
||||
pub mod xcm;
|
||||
|
||||
|
||||
@@ -29,10 +29,10 @@ use pezframe_support::{
|
||||
},
|
||||
};
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezpallet_collator_selection::StakingPotAccountId;
|
||||
use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough};
|
||||
use pezkuwi_runtime_common::xcm_sender::ExponentialPrice;
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use pezpallet_collator_selection::StakingPotAccountId;
|
||||
use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough};
|
||||
use pezsp_runtime::traits::AccountIdConversion;
|
||||
use testnet_teyrchains_constants::zagros::{
|
||||
locations::AssetHubLocation, snowbridge::EthereumNetwork,
|
||||
@@ -161,8 +161,8 @@ pub type Barrier = TrailingSetTopicAsId<
|
||||
// If the message is one that immediately attempts to pay for execution, then
|
||||
// allow it.
|
||||
AllowTopLevelPaidExecutionFrom<Everything>,
|
||||
// Parent, its pluralities (i.e. governance bodies) and relay treasury pezpallet
|
||||
// get free execution.
|
||||
// Parent, its pluralities (i.e. governance bodies) and relay treasury
|
||||
// pezpallet get free execution.
|
||||
AllowExplicitUnpaidExecutionFrom<(
|
||||
ParentOrParentsPlurality,
|
||||
Equals<RelayTreasuryLocation>,
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
use bp_asset_hub_zagros::ASSET_HUB_ZAGROS_TEYRCHAIN_ID;
|
||||
use bp_bridge_hub_zagros::BRIDGE_HUB_ZAGROS_TEYRCHAIN_ID;
|
||||
use bp_pezkuwi_core::Signature;
|
||||
use codec::{Decode, Encode};
|
||||
use pezbridge_hub_zagros_runtime::{
|
||||
bridge_to_pezkuwichain_config, xcm_config::XcmConfig, AllPalletsWithoutSystem,
|
||||
BridgeRejectObsoleteHeadersAndMessages, Executive, MessageQueueServiceWeight, Runtime,
|
||||
RuntimeCall, RuntimeEvent, SessionKeys, TxExtension, UncheckedExtrinsic,
|
||||
};
|
||||
use codec::{Decode, Encode};
|
||||
use pezcumulus_primitives_core::XcmError::FailedToTransactAsset;
|
||||
use pezframe_support::parameter_types;
|
||||
use pezsnowbridge_pezpallet_ethereum_client::WeightInfo;
|
||||
@@ -98,7 +98,8 @@ pub fn transfer_token_to_ethereum_insufficient_fund() {
|
||||
fn max_message_queue_service_weight_is_more_than_beacon_extrinsic_weights() {
|
||||
let max_message_queue_weight = MessageQueueServiceWeight::get();
|
||||
let force_checkpoint =
|
||||
<Runtime as pezsnowbridge_pezpallet_ethereum_client::Config>::WeightInfo::force_checkpoint();
|
||||
<Runtime as pezsnowbridge_pezpallet_ethereum_client::Config>::WeightInfo::force_checkpoint(
|
||||
);
|
||||
let submit_checkpoint =
|
||||
<Runtime as pezsnowbridge_pezpallet_ethereum_client::Config>::WeightInfo::submit();
|
||||
max_message_queue_weight.all_gt(force_checkpoint);
|
||||
@@ -124,9 +125,9 @@ fn ethereum_to_pezkuwi_message_extrinsics_work() {
|
||||
}
|
||||
|
||||
/// Tests that the digest items are as expected when a Ethereum Outbound message is received.
|
||||
/// If the MessageQueue pezpallet is configured before (i.e. the MessageQueue pezpallet is listed before
|
||||
/// the EthereumOutboundQueue in the construct_runtime macro) the EthereumOutboundQueue, this test
|
||||
/// will fail.
|
||||
/// If the MessageQueue pezpallet is configured before (i.e. the MessageQueue pezpallet is listed
|
||||
/// before the EthereumOutboundQueue in the construct_runtime macro) the EthereumOutboundQueue, this
|
||||
/// test will fail.
|
||||
#[test]
|
||||
pub fn ethereum_outbound_queue_processes_messages_before_message_queue_works() {
|
||||
pezsnowbridge_runtime_test_common::ethereum_outbound_queue_processes_messages_before_message_queue_works::<
|
||||
|
||||
@@ -21,6 +21,13 @@ use bp_messages::LegacyLaneId;
|
||||
use bp_pezkuwi_core::Signature;
|
||||
use bp_relayers::{PayRewardFromAccount, RewardsAccountOwner, RewardsAccountParams};
|
||||
use bridge_common_config::{BridgeRelayersInstance, BridgeReward, RequiredStakeForStakeAndSlash};
|
||||
use bridge_to_pezkuwichain_config::{
|
||||
BridgeGrandpaPezkuwichainInstance, BridgeHubPezkuwichainLocation,
|
||||
BridgeTeyrchainPezkuwichainInstance, DeliveryRewardInBalance,
|
||||
WithBridgeHubPezkuwichainMessagesInstance, XcmOverBridgeHubPezkuwichainInstance,
|
||||
};
|
||||
use codec::{Decode, Encode};
|
||||
use hex_literal::hex;
|
||||
use pezbridge_hub_test_utils::{
|
||||
test_cases::{from_teyrchain, run_test},
|
||||
GovernanceOrigin, SlotDurations,
|
||||
@@ -36,12 +43,6 @@ use pezbridge_hub_zagros_runtime::{
|
||||
RuntimeOrigin, SessionKeys, TeyrchainSystem, TransactionPayment, TxExtension,
|
||||
UncheckedExtrinsic,
|
||||
};
|
||||
use bridge_to_pezkuwichain_config::{
|
||||
BridgeGrandpaPezkuwichainInstance, BridgeHubPezkuwichainLocation,
|
||||
BridgeTeyrchainPezkuwichainInstance, DeliveryRewardInBalance,
|
||||
WithBridgeHubPezkuwichainMessagesInstance, XcmOverBridgeHubPezkuwichainInstance,
|
||||
};
|
||||
use codec::{Decode, Encode};
|
||||
use pezcumulus_primitives_core::UpwardMessageSender;
|
||||
use pezframe_support::{
|
||||
assert_err, assert_ok,
|
||||
@@ -52,7 +53,6 @@ use pezframe_support::{
|
||||
ConstU8,
|
||||
},
|
||||
};
|
||||
use hex_literal::hex;
|
||||
use pezsp_consensus_aura::SlotDuration;
|
||||
use pezsp_core::crypto::Ss58Codec;
|
||||
use pezsp_keyring::Sr25519Keyring::{Alice, Bob};
|
||||
|
||||
@@ -21,9 +21,9 @@ use pezframe_support::{
|
||||
weights::WeightMeter,
|
||||
};
|
||||
use pezpallet_message_queue::OnQueueChanged;
|
||||
use scale_info::TypeInfo;
|
||||
use pezsnowbridge_core::ChannelId;
|
||||
use pezsp_core::H256;
|
||||
use scale_info::TypeInfo;
|
||||
use xcm::latest::prelude::{Junction, Location};
|
||||
|
||||
/// The aggregate origin of an inbound message.
|
||||
|
||||
+14
-7
@@ -129,7 +129,8 @@ pub fn relayed_incoming_message_works<RuntimeHelper>(
|
||||
+ From<BridgeMessagesCall<RuntimeHelper::Runtime, RuntimeHelper::MPI>>,
|
||||
BridgedChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>: Chain<Hash = ParaHash> + Teyrchain,
|
||||
<RuntimeHelper::Runtime as BridgeGrandpaConfig<RuntimeHelper::GPI>>::BridgedChain:
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber>
|
||||
+ ChainWithGrandpa,
|
||||
{
|
||||
helpers::relayed_incoming_message_works::<
|
||||
RuntimeHelper::Runtime,
|
||||
@@ -264,7 +265,8 @@ pub fn free_relay_extrinsic_works<RuntimeHelper>(
|
||||
+ From<BridgeMessagesCall<RuntimeHelper::Runtime, RuntimeHelper::MPI>>,
|
||||
BridgedChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>: Chain<Hash = ParaHash> + Teyrchain,
|
||||
<RuntimeHelper::Runtime as BridgeGrandpaConfig<RuntimeHelper::GPI>>::BridgedChain:
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber>
|
||||
+ ChainWithGrandpa,
|
||||
{
|
||||
// ensure that the runtime allows free header submissions
|
||||
let free_headers_interval = <RuntimeHelper::Runtime as BridgeGrandpaConfig<
|
||||
@@ -433,7 +435,8 @@ pub fn complex_relay_extrinsic_works<RuntimeHelper>(
|
||||
+ From<pezpallet_utility::Call<RuntimeHelper::Runtime>>,
|
||||
BridgedChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>: Chain<Hash = ParaHash> + Teyrchain,
|
||||
<RuntimeHelper::Runtime as BridgeGrandpaConfig<RuntimeHelper::GPI>>::BridgedChain:
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber>
|
||||
+ ChainWithGrandpa,
|
||||
{
|
||||
helpers::relayed_incoming_message_works::<
|
||||
RuntimeHelper::Runtime,
|
||||
@@ -560,7 +563,8 @@ where
|
||||
+ From<BridgeMessagesCall<RuntimeHelper::Runtime, RuntimeHelper::MPI>>,
|
||||
BridgedChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>: Chain<Hash = ParaHash> + Teyrchain,
|
||||
<RuntimeHelper::Runtime as BridgeGrandpaConfig<RuntimeHelper::GPI>>::BridgedChain:
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber>
|
||||
+ ChainWithGrandpa,
|
||||
{
|
||||
run_test::<RuntimeHelper::Runtime, _>(collator_session_key, 1000, vec![], || {
|
||||
// generate bridged relay chain finality, teyrchain heads and message proofs,
|
||||
@@ -630,7 +634,8 @@ where
|
||||
+ From<BridgeMessagesCall<RuntimeHelper::Runtime, RuntimeHelper::MPI>>,
|
||||
BridgedChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>: Chain<Hash = ParaHash> + Teyrchain,
|
||||
<RuntimeHelper::Runtime as BridgeGrandpaConfig<RuntimeHelper::GPI>>::BridgedChain:
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber>
|
||||
+ ChainWithGrandpa,
|
||||
{
|
||||
run_test::<RuntimeHelper::Runtime, _>(collator_session_key, 1000, vec![], || {
|
||||
// generate bridged relay chain finality, teyrchain heads and message proofs,
|
||||
@@ -694,7 +699,8 @@ where
|
||||
From<BridgeMessagesCall<RuntimeHelper::Runtime, RuntimeHelper::MPI>>,
|
||||
BridgedChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>: Chain<Hash = ParaHash> + Teyrchain,
|
||||
<RuntimeHelper::Runtime as BridgeGrandpaConfig<RuntimeHelper::GPI>>::BridgedChain:
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber>
|
||||
+ ChainWithGrandpa,
|
||||
{
|
||||
run_test::<RuntimeHelper::Runtime, _>(collator_session_key, 1000, vec![], || {
|
||||
// generate bridged relay chain finality, teyrchain heads and message proofs,
|
||||
@@ -755,7 +761,8 @@ where
|
||||
From<BridgeMessagesCall<RuntimeHelper::Runtime, RuntimeHelper::MPI>>,
|
||||
BridgedChainOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>: Chain<Hash = ParaHash> + Teyrchain,
|
||||
<RuntimeHelper::Runtime as BridgeGrandpaConfig<RuntimeHelper::GPI>>::BridgedChain:
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber>
|
||||
+ ChainWithGrandpa,
|
||||
{
|
||||
run_test::<RuntimeHelper::Runtime, _>(collator_session_key, 1000, vec![], || {
|
||||
// generate bridged relay chain finality, teyrchain heads and message proofs,
|
||||
|
||||
@@ -21,9 +21,9 @@ use crate::test_cases::{bridges_prelude::*, run_test, RuntimeHelper};
|
||||
use asset_test_pezutils::BasicTeyrchainRuntime;
|
||||
use bp_messages::MessageNonce;
|
||||
use bp_pezkuwi_core::teyrchains::{ParaHash, ParaId};
|
||||
use pezbp_runtime::Chain;
|
||||
use codec::Decode;
|
||||
use core::marker::PhantomData;
|
||||
use pezbp_runtime::Chain;
|
||||
use pezframe_support::{
|
||||
assert_ok,
|
||||
dispatch::GetDispatchInfo,
|
||||
@@ -93,7 +93,8 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Checks that the best teyrchain header hash in the bridge teyrchains pezpallet 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,
|
||||
@@ -122,8 +123,10 @@ where
|
||||
{
|
||||
fn verify_outcome(&self) {
|
||||
assert_eq!(
|
||||
pezpallet_bridge_teyrchains::ParasInfo::<Runtime, PPI>::get(ParaId(self.bridged_para_id))
|
||||
.map(|info| info.best_head_hash.head_hash),
|
||||
pezpallet_bridge_teyrchains::ParasInfo::<Runtime, PPI>::get(ParaId(
|
||||
self.bridged_para_id
|
||||
))
|
||||
.map(|info| info.best_head_hash.head_hash),
|
||||
Some(self.expected_best_hash),
|
||||
);
|
||||
}
|
||||
@@ -222,7 +225,10 @@ where
|
||||
Runtime: pezpallet_balances::Config,
|
||||
{
|
||||
fn verify_outcome(&self) {
|
||||
assert_eq!(pezpallet_balances::Pezpallet::<Runtime>::free_balance(&self.relayer), self.balance,);
|
||||
assert_eq!(
|
||||
pezpallet_balances::Pezpallet::<Runtime>::free_balance(&self.relayer),
|
||||
self.balance,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,7 +280,8 @@ pub fn relayed_incoming_message_works<Runtime, AllPalletsWithoutSystem, MPI>(
|
||||
pezbp_runtime::ChainId,
|
||||
) -> CallsAndVerifiers<Runtime>,
|
||||
) where
|
||||
Runtime: BasicTeyrchainRuntime + pezcumulus_pezpallet_xcmp_queue::Config + BridgeMessagesConfig<MPI>,
|
||||
Runtime:
|
||||
BasicTeyrchainRuntime + pezcumulus_pezpallet_xcmp_queue::Config + BridgeMessagesConfig<MPI>,
|
||||
AllPalletsWithoutSystem:
|
||||
OnInitialize<BlockNumberFor<Runtime>> + OnFinalize<BlockNumberFor<Runtime>>,
|
||||
MPI: 'static,
|
||||
@@ -307,7 +314,10 @@ pub fn relayed_incoming_message_works<Runtime, AllPalletsWithoutSystem, MPI>(
|
||||
2,
|
||||
AccountId::from(alice).into(),
|
||||
);
|
||||
mock_open_hrmp_channel::<Runtime, pezcumulus_pezpallet_teyrchain_system::Pezpallet<Runtime>>(
|
||||
mock_open_hrmp_channel::<
|
||||
Runtime,
|
||||
pezcumulus_pezpallet_teyrchain_system::Pezpallet<Runtime>,
|
||||
>(
|
||||
runtime_para_id.into(),
|
||||
sibling_teyrchain_id.into(),
|
||||
included_head,
|
||||
@@ -439,9 +449,11 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
buy_execution_fee_amount.into();
|
||||
let source_account_id =
|
||||
LocationToAccountId::convert_location(&source).expect("valid location");
|
||||
let _ =
|
||||
<pezpallet_balances::Pezpallet<Runtime>>::mint_into(&source_account_id, balance_needed)
|
||||
.expect("mint_into passes");
|
||||
let _ = <pezpallet_balances::Pezpallet<Runtime>>::mint_into(
|
||||
&source_account_id,
|
||||
balance_needed,
|
||||
)
|
||||
.expect("mint_into passes");
|
||||
Some(buy_execution_fee)
|
||||
} else {
|
||||
None
|
||||
@@ -451,10 +463,11 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
bridge_opener(*locations.clone(), maybe_paid_execution);
|
||||
|
||||
// check opened bridge
|
||||
let bridge = pezpallet_xcm_bridge_hub::Bridges::<Runtime, XcmOverBridgePalletInstance>::get(
|
||||
locations.bridge_id(),
|
||||
)
|
||||
.expect("opened bridge");
|
||||
let bridge =
|
||||
pezpallet_xcm_bridge_hub::Bridges::<Runtime, XcmOverBridgePalletInstance>::get(
|
||||
locations.bridge_id(),
|
||||
)
|
||||
.expect("opened bridge");
|
||||
|
||||
// check state
|
||||
assert_ok!(
|
||||
@@ -498,8 +511,8 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
.ensure_complete());
|
||||
}
|
||||
|
||||
/// Utility for opening bridge directly inserting data to the `pezpallet_xcm_bridge_hub`'s storage
|
||||
/// (used only for legacy purposes).
|
||||
/// Utility for opening bridge directly inserting data to the `pezpallet_xcm_bridge_hub`'s
|
||||
/// storage (used only for legacy purposes).
|
||||
pub fn open_bridge_with_storage<Runtime, XcmOverBridgePalletInstance>(
|
||||
locations: pezpallet_xcm_bridge_hub::BridgeLocations,
|
||||
lane_id: pezpallet_xcm_bridge_hub::LaneIdOf<Runtime, XcmOverBridgePalletInstance>,
|
||||
@@ -554,9 +567,11 @@ pub(crate) mod for_pallet_xcm_bridge_hub {
|
||||
buy_execution_fee_amount.into();
|
||||
let source_account_id =
|
||||
LocationToAccountId::convert_location(&expected_source).expect("valid location");
|
||||
let _ =
|
||||
<pezpallet_balances::Pezpallet<Runtime>>::mint_into(&source_account_id, balance_needed)
|
||||
.expect("mint_into passes");
|
||||
let _ = <pezpallet_balances::Pezpallet<Runtime>>::mint_into(
|
||||
&source_account_id,
|
||||
balance_needed,
|
||||
)
|
||||
.expect("mint_into passes");
|
||||
Some(buy_execution_fee)
|
||||
} else {
|
||||
None
|
||||
|
||||
@@ -31,8 +31,8 @@ use bp_messages::{
|
||||
target_chain::{DispatchMessage, DispatchMessageData, MessageDispatch},
|
||||
LaneState, MessageKey, MessagesOperatingMode, OutboundLaneData,
|
||||
};
|
||||
use pezbp_runtime::BasicOperatingMode;
|
||||
use codec::Encode;
|
||||
use pezbp_runtime::BasicOperatingMode;
|
||||
use pezframe_support::{
|
||||
assert_ok,
|
||||
dispatch::GetDispatchInfo,
|
||||
@@ -320,7 +320,9 @@ pub fn handle_export_message_from_system_teyrchain_to_outbound_queue_works<
|
||||
runtime_para_id: u32,
|
||||
sibling_teyrchain_id: u32,
|
||||
unwrap_pallet_bridge_messages_event: Box<
|
||||
dyn Fn(Vec<u8>) -> Option<pezpallet_bridge_messages::Event<Runtime, MessagesPalletInstance>>,
|
||||
dyn Fn(
|
||||
Vec<u8>,
|
||||
) -> Option<pezpallet_bridge_messages::Event<Runtime, MessagesPalletInstance>>,
|
||||
>,
|
||||
export_message_instruction: fn() -> Instruction<XcmConfig::RuntimeCall>,
|
||||
existential_deposit: Option<Asset>,
|
||||
@@ -409,7 +411,9 @@ pub fn handle_export_message_from_system_teyrchain_to_outbound_queue_works<
|
||||
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 { .. })));
|
||||
assert!(
|
||||
events.any(|e| matches!(e, pezpallet_bridge_messages::Event::MessageAccepted { .. }))
|
||||
);
|
||||
})
|
||||
}
|
||||
|
||||
@@ -565,9 +569,8 @@ pub fn message_dispatch_routing_works<
|
||||
let mut events = <pezframe_system::Pezpallet<Runtime>>::events()
|
||||
.into_iter()
|
||||
.filter_map(|e| unwrap_pezcumulus_pezpallet_xcmp_queue_event(e.event.encode()));
|
||||
assert!(
|
||||
events.any(|e| matches!(e, pezcumulus_pezpallet_xcmp_queue::Event::XcmpMessageSent { .. }))
|
||||
);
|
||||
assert!(events
|
||||
.any(|e| matches!(e, pezcumulus_pezpallet_xcmp_queue::Event::XcmpMessageSent { .. })));
|
||||
})
|
||||
}
|
||||
|
||||
@@ -689,10 +692,13 @@ 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::Pezpallet::<Runtime, XcmOverBridgePalletInstance>::bridge_locations(
|
||||
expected_source.clone().into(),
|
||||
destination.clone().into(),
|
||||
).expect("valid bridge locations");
|
||||
let locations = pezpallet_xcm_bridge_hub::Pezpallet::<
|
||||
Runtime,
|
||||
XcmOverBridgePalletInstance,
|
||||
>::bridge_locations(
|
||||
expected_source.clone().into(), destination.clone().into()
|
||||
)
|
||||
.expect("valid bridge locations");
|
||||
let expected_lane_id =
|
||||
locations.calculate_lane_id(xcm::latest::VERSION).expect("valid laneId");
|
||||
let lanes_manager = LanesManagerOf::<Runtime, XcmOverBridgePalletInstance>::new();
|
||||
|
||||
+1
-1
@@ -23,9 +23,9 @@ use bp_messages::{
|
||||
target_chain::FromBridgedChainMessagesProof, ChainWithMessages, LaneState, MessageNonce,
|
||||
UnrewardedRelayersState,
|
||||
};
|
||||
use pezbp_runtime::{AccountIdOf, BlockNumberOf, Chain, HeaderOf, UnverifiedStorageProofParams};
|
||||
use bp_test_utils::make_default_justification;
|
||||
use codec::Encode;
|
||||
use pezbp_runtime::{AccountIdOf, BlockNumberOf, Chain, HeaderOf, UnverifiedStorageProofParams};
|
||||
use pezpallet_bridge_grandpa::{BridgedChain, BridgedHeader};
|
||||
use pezsp_runtime::traits::Header as HeaderT;
|
||||
use xcm::latest::prelude::*;
|
||||
|
||||
+29
-27
@@ -26,12 +26,12 @@ use bp_messages::{
|
||||
target_chain::FromBridgedChainMessagesProof, ChainWithMessages, LaneState,
|
||||
UnrewardedRelayersState, Weight,
|
||||
};
|
||||
use pezbp_runtime::{
|
||||
AccountIdOf, BlockNumberOf, Chain, HeaderOf, Teyrchain, UnverifiedStorageProofParams,
|
||||
};
|
||||
use bp_test_utils::prepare_teyrchain_heads_proof;
|
||||
use bp_teyrchains::{RelayBlockHash, RelayBlockNumber};
|
||||
use codec::Encode;
|
||||
use pezbp_runtime::{
|
||||
AccountIdOf, BlockNumberOf, Chain, HeaderOf, Teyrchain, UnverifiedStorageProofParams,
|
||||
};
|
||||
use pezpallet_bridge_grandpa::BridgedHeader;
|
||||
use pezsp_runtime::traits::Header as HeaderT;
|
||||
use xcm::latest::prelude::*;
|
||||
@@ -82,14 +82,15 @@ where
|
||||
finality_target: Box::new(relay_chain_header),
|
||||
justification: grandpa_justification,
|
||||
};
|
||||
let submit_para_head = pezpallet_bridge_teyrchains::Call::<Runtime, PPI>::submit_teyrchain_heads {
|
||||
at_relay_block: (
|
||||
relay_chain_header_number.saturated_into(),
|
||||
relay_chain_header_hash.into(),
|
||||
),
|
||||
teyrchains: teyrchain_heads,
|
||||
teyrchain_heads_proof: para_heads_proof,
|
||||
};
|
||||
let submit_para_head =
|
||||
pezpallet_bridge_teyrchains::Call::<Runtime, PPI>::submit_teyrchain_heads {
|
||||
at_relay_block: (
|
||||
relay_chain_header_number.saturated_into(),
|
||||
relay_chain_header_hash.into(),
|
||||
),
|
||||
teyrchains: teyrchain_heads,
|
||||
teyrchain_heads_proof: para_heads_proof,
|
||||
};
|
||||
let submit_message = pezpallet_bridge_messages::Call::<Runtime, MPI>::receive_messages_proof {
|
||||
relayer_id_at_bridged_chain: relayer_id_at_bridged_chain.into(),
|
||||
proof: Box::new(message_proof),
|
||||
@@ -119,8 +120,8 @@ where
|
||||
GPI: 'static,
|
||||
PPI: 'static,
|
||||
MPI: 'static,
|
||||
<Runtime as pezpallet_bridge_grandpa::Config<GPI>>::BridgedChain:
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
<Runtime as pezpallet_bridge_grandpa::Config<GPI>>::BridgedChain: pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber>
|
||||
+ ChainWithGrandpa,
|
||||
BridgedChainOf<Runtime, MPI>: Chain<Hash = ParaHash> + Teyrchain,
|
||||
<Runtime as pezpallet_utility::Config>::RuntimeCall: From<pezpallet_bridge_grandpa::Call<Runtime, GPI>>
|
||||
+ From<pezpallet_bridge_teyrchains::Call<Runtime, PPI>>
|
||||
@@ -132,14 +133,15 @@ where
|
||||
finality_target: Box::new(relay_chain_header),
|
||||
justification: grandpa_justification,
|
||||
};
|
||||
let submit_para_head = pezpallet_bridge_teyrchains::Call::<Runtime, PPI>::submit_teyrchain_heads {
|
||||
at_relay_block: (
|
||||
relay_chain_header_number.saturated_into(),
|
||||
relay_chain_header_hash.into(),
|
||||
),
|
||||
teyrchains: teyrchain_heads,
|
||||
teyrchain_heads_proof: para_heads_proof,
|
||||
};
|
||||
let submit_para_head =
|
||||
pezpallet_bridge_teyrchains::Call::<Runtime, PPI>::submit_teyrchain_heads {
|
||||
at_relay_block: (
|
||||
relay_chain_header_number.saturated_into(),
|
||||
relay_chain_header_hash.into(),
|
||||
),
|
||||
teyrchains: teyrchain_heads,
|
||||
teyrchain_heads_proof: para_heads_proof,
|
||||
};
|
||||
let submit_message_delivery_proof =
|
||||
pezpallet_bridge_messages::Call::<Runtime, MPI>::receive_messages_delivery_proof {
|
||||
proof: message_delivery_proof,
|
||||
@@ -216,8 +218,8 @@ pub fn make_complex_relayer_delivery_proofs<
|
||||
FromBridgedChainMessagesProof<ParaHash, LaneId>,
|
||||
)
|
||||
where
|
||||
BridgedRelayChain:
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
BridgedRelayChain: pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber>
|
||||
+ ChainWithGrandpa,
|
||||
BridgedTeyrchain: pezbp_runtime::Chain<Hash = ParaHash> + Teyrchain,
|
||||
ThisChainWithMessages: ChainWithMessages,
|
||||
LaneId: Copy + Encode,
|
||||
@@ -287,8 +289,8 @@ pub fn make_complex_relayer_confirmation_proofs<
|
||||
FromBridgedChainMessagesDeliveryProof<ParaHash, LaneId>,
|
||||
)
|
||||
where
|
||||
BridgedRelayChain:
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
BridgedRelayChain: pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber>
|
||||
+ ChainWithGrandpa,
|
||||
BridgedTeyrchain: pezbp_runtime::Chain<Hash = ParaHash> + Teyrchain,
|
||||
ThisChainWithMessages: ChainWithMessages,
|
||||
LaneId: Copy + Encode,
|
||||
@@ -352,8 +354,8 @@ pub fn make_complex_bridged_teyrchain_heads_proof<BridgedRelayChain, BridgedTeyr
|
||||
ParaHeadsProof,
|
||||
)
|
||||
where
|
||||
BridgedRelayChain:
|
||||
pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber> + ChainWithGrandpa,
|
||||
BridgedRelayChain: pezbp_runtime::Chain<Hash = RelayBlockHash, BlockNumber = RelayBlockNumber>
|
||||
+ ChainWithGrandpa,
|
||||
BridgedTeyrchain: pezbp_runtime::Chain<Hash = ParaHash> + Teyrchain,
|
||||
{
|
||||
let bridged_para_head = ParaHead(
|
||||
|
||||
@@ -29,8 +29,8 @@ use pezpallet_bridge_grandpa::BridgedHeader;
|
||||
use xcm::latest::prelude::*;
|
||||
|
||||
use bp_messages::MessageNonce;
|
||||
use pezbp_runtime::BasicOperatingMode;
|
||||
use bp_test_utils::authority_list;
|
||||
use pezbp_runtime::BasicOperatingMode;
|
||||
use xcm::GetVersion;
|
||||
use xcm_builder::{BridgeMessage, HaulBlob, HaulBlobError, HaulBlobExporter};
|
||||
use xcm_executor::traits::{validate_export, ExportXcm};
|
||||
|
||||
@@ -33,14 +33,16 @@ mod tracks;
|
||||
|
||||
use super::*;
|
||||
use crate::xcm_config::{FellowshipAdminBodyId, LocationToAccountId, WndAssetHub};
|
||||
use pezframe_support::traits::{EitherOf, MapSuccess, TryMapSuccess};
|
||||
use pezframe_system::EnsureRootWithSuccess;
|
||||
pub use origins::pezpallet_origins as pezpallet_ambassador_origins;
|
||||
use origins::pezpallet_origins::{
|
||||
EnsureAmbassadorsVoice, EnsureAmbassadorsVoiceFrom, EnsureHeadAmbassadorsVoice, Origin,
|
||||
};
|
||||
use pezframe_support::traits::{EitherOf, MapSuccess, TryMapSuccess};
|
||||
use pezframe_system::EnsureRootWithSuccess;
|
||||
use pezsp_core::ConstU128;
|
||||
use pezsp_runtime::traits::{CheckedReduceBy, ConstU16, ConvertToValue, Replace, ReplaceWithDefault};
|
||||
use pezsp_runtime::traits::{
|
||||
CheckedReduceBy, ConstU16, ConvertToValue, Replace, ReplaceWithDefault,
|
||||
};
|
||||
use xcm::prelude::*;
|
||||
use xcm_builder::{AliasesIntoAccountId32, PayOverXcm};
|
||||
|
||||
@@ -106,7 +108,8 @@ pub type PromoteOrigin = EitherOf<
|
||||
pub type ExchangeOrigin = EitherOf<EnsureRootWithSuccess<AccountId, ConstU16<65535>>, Fellows>;
|
||||
|
||||
impl pezpallet_ranked_collective::Config<AmbassadorCollectiveInstance> for Runtime {
|
||||
type WeightInfo = weights::pezpallet_ranked_collective_ambassador_collective::WeightInfo<Runtime>;
|
||||
type WeightInfo =
|
||||
weights::pezpallet_ranked_collective_ambassador_collective::WeightInfo<Runtime>;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type AddOrigin = MapSuccess<Self::PromoteOrigin, ReplaceWithDefault<()>>;
|
||||
type PromoteOrigin = PromoteOrigin;
|
||||
|
||||
+10
-8
@@ -25,6 +25,10 @@ use crate::{
|
||||
Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, Scheduler, TeyrchainInfo,
|
||||
ZagrosTreasuryAccount, DAYS,
|
||||
};
|
||||
pub use origins::{
|
||||
pezpallet_origins as pezpallet_fellowship_origins, Architects, EnsureCanPromoteTo,
|
||||
EnsureCanRetainAt, EnsureFellowship, Fellows, Masters, Members, ToVoice,
|
||||
};
|
||||
use pezcumulus_primitives_core::ParaId;
|
||||
use pezframe_support::{
|
||||
parameter_types,
|
||||
@@ -35,15 +39,11 @@ use pezframe_support::{
|
||||
PalletId,
|
||||
};
|
||||
use pezframe_system::{EnsureRoot, EnsureRootWithSuccess};
|
||||
pub use origins::{
|
||||
pezpallet_origins as pezpallet_fellowship_origins, Architects, EnsureCanPromoteTo, EnsureCanRetainAt,
|
||||
EnsureFellowship, Fellows, Masters, Members, ToVoice,
|
||||
};
|
||||
use pezpallet_ranked_collective::EnsureOfRank;
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
use pezkuwi_runtime_common::impls::{
|
||||
ContainsParts, LocatableAssetConverter, VersionedLocatableAsset, VersionedLocationConverter,
|
||||
};
|
||||
use pezpallet_ranked_collective::EnsureOfRank;
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
use pezsp_arithmetic::Permill;
|
||||
use pezsp_core::{ConstU128, ConstU32, ConstU8};
|
||||
use pezsp_runtime::traits::{ConstU16, ConvertToValue, IdentityLookup, Replace, TakeFirst};
|
||||
@@ -112,10 +112,12 @@ impl pezpallet_referenda::Config<FellowshipReferendaInstance> for Runtime {
|
||||
pub type FellowshipCollectiveInstance = pezpallet_ranked_collective::Instance1;
|
||||
|
||||
impl pezpallet_ranked_collective::Config<FellowshipCollectiveInstance> for Runtime {
|
||||
type WeightInfo = weights::pezpallet_ranked_collective_fellowship_collective::WeightInfo<Runtime>;
|
||||
type WeightInfo =
|
||||
weights::pezpallet_ranked_collective_fellowship_collective::WeightInfo<Runtime>;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
|
||||
// Promotions and the induction of new members are serviced by `FellowshipCore` pezpallet instance.
|
||||
// Promotions and the induction of new members are serviced by `FellowshipCore` pezpallet
|
||||
// instance.
|
||||
#[cfg(not(feature = "runtime-benchmarks"))]
|
||||
type AddOrigin = pezframe_system::EnsureNever<()>;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
|
||||
+24
-20
@@ -83,16 +83,18 @@ const RETAIN_PREPARE_PERIOD: BlockNumber = 0;
|
||||
const RETAIN_DECISION_PERIOD: BlockNumber = 14 * DAYS;
|
||||
const RETAIN_CONFIRM_PERIOD: BlockNumber = 1 * HOURS;
|
||||
const RETAIN_MIN_ENACTMENT_PERIOD: BlockNumber = 0;
|
||||
const RETAIN_MIN_APPROVAL: pezpallet_referenda::Curve = pezpallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(60),
|
||||
ceil: Perbill::from_percent(100),
|
||||
};
|
||||
const RETAIN_MIN_SUPPORT: pezpallet_referenda::Curve = pezpallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(10),
|
||||
ceil: Perbill::from_percent(100),
|
||||
};
|
||||
const RETAIN_MIN_APPROVAL: pezpallet_referenda::Curve =
|
||||
pezpallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(60),
|
||||
ceil: Perbill::from_percent(100),
|
||||
};
|
||||
const RETAIN_MIN_SUPPORT: pezpallet_referenda::Curve =
|
||||
pezpallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(10),
|
||||
ceil: Perbill::from_percent(100),
|
||||
};
|
||||
|
||||
const PROMOTE_MAX_DECIDING: u32 = 10;
|
||||
const PROMOTE_DECISION_DEPOSIT: Balance = 5 * DOLLARS;
|
||||
@@ -100,16 +102,18 @@ const PROMOTE_PREPARE_PERIOD: BlockNumber = 0;
|
||||
const PROMOTE_DECISION_PERIOD: BlockNumber = 30 * DAYS;
|
||||
const PROMOTE_CONFIRM_PERIOD: BlockNumber = 1 * HOURS;
|
||||
const PROMOTE_MIN_ENACTMENT_PERIOD: BlockNumber = 0;
|
||||
const PROMOTE_MIN_APPROVAL: pezpallet_referenda::Curve = pezpallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(60),
|
||||
ceil: Perbill::from_percent(100),
|
||||
};
|
||||
const PROMOTE_MIN_SUPPORT: pezpallet_referenda::Curve = pezpallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(10),
|
||||
ceil: Perbill::from_percent(100),
|
||||
};
|
||||
const PROMOTE_MIN_APPROVAL: pezpallet_referenda::Curve =
|
||||
pezpallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(60),
|
||||
ceil: Perbill::from_percent(100),
|
||||
};
|
||||
const PROMOTE_MIN_SUPPORT: pezpallet_referenda::Curve =
|
||||
pezpallet_referenda::Curve::LinearDecreasing {
|
||||
length: Perbill::from_percent(100),
|
||||
floor: Perbill::from_percent(10),
|
||||
ceil: Perbill::from_percent(100),
|
||||
};
|
||||
|
||||
pub struct TracksInfo;
|
||||
impl pezpallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
|
||||
|
||||
@@ -31,8 +31,9 @@ type ProposalOf<T, I> = <T as pezpallet_collective::Config<I>>::Proposal;
|
||||
type HashOf<T> = <T as pezframe_system::Config>::Hash;
|
||||
|
||||
/// Type alias to conveniently refer to the `Currency::Balance` associated type.
|
||||
pub type BalanceOf<T> =
|
||||
<pezpallet_balances::Pezpallet<T> as Currency<<T as pezframe_system::Config>::AccountId>>::Balance;
|
||||
pub type BalanceOf<T> = <pezpallet_balances::Pezpallet<T> as Currency<
|
||||
<T as pezframe_system::Config>::AccountId,
|
||||
>>::Balance;
|
||||
|
||||
/// Proposal provider for alliance pezpallet.
|
||||
/// Adapter from collective pezpallet to alliance proposal provider trait.
|
||||
|
||||
@@ -53,9 +53,9 @@ pub use ambassador::pezpallet_ambassador_origins;
|
||||
|
||||
use alloc::{vec, vec::Vec};
|
||||
use ambassador::AmbassadorCoreInstance;
|
||||
use pezcumulus_pezpallet_teyrchain_system::RelayNumberMonotonicallyIncreases;
|
||||
use fellowship::{pezpallet_fellowship_origins, Fellows, FellowshipCoreInstance};
|
||||
use impls::{AllianceProposalProvider, EqualOrGreatestRootCmp};
|
||||
use pezcumulus_pezpallet_teyrchain_system::RelayNumberMonotonicallyIncreases;
|
||||
use pezsp_api::impl_runtime_apis;
|
||||
use pezsp_core::{crypto::KeyTypeId, OpaqueMetadata};
|
||||
use pezsp_runtime::{
|
||||
@@ -107,10 +107,10 @@ use xcm_config::{
|
||||
pub use pezsp_runtime::BuildStorage;
|
||||
|
||||
// Pezkuwi imports
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
use pezkuwi_runtime_common::{
|
||||
impls::VersionedLocatableAsset, BlockHashCount, SlowAdjustingFeeUpdate,
|
||||
};
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
use xcm::{prelude::*, Version as XcmVersion};
|
||||
use xcm_runtime_pezapis::{
|
||||
dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects},
|
||||
@@ -512,7 +512,8 @@ impl pezpallet_session::Config for Runtime {
|
||||
// we don't have stash and controller, thus we don't need the convert as well.
|
||||
type ValidatorIdOf = pezpallet_collator_selection::IdentityCollator;
|
||||
type ShouldEndSession = pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type NextSessionRotation = pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type NextSessionRotation =
|
||||
pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type SessionManager = CollatorSelection;
|
||||
// Essentially just Aura, but let's be pedantic.
|
||||
type SessionHandler = <SessionKeys as pezsp_runtime::traits::OpaqueKeys>::KeyTypeIdProviders;
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
// limitations under the License.
|
||||
|
||||
pub mod block_weights;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod paritydb_weights;
|
||||
pub mod pezcumulus_pezpallet_teyrchain_system;
|
||||
pub mod pezcumulus_pezpallet_weight_reclaim;
|
||||
pub mod pezcumulus_pezpallet_xcmp_queue;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod pezframe_system;
|
||||
pub mod pezframe_system_extensions;
|
||||
pub mod pezpallet_alliance;
|
||||
@@ -45,7 +46,6 @@ pub mod pezpallet_transaction_payment;
|
||||
pub mod pezpallet_treasury;
|
||||
pub mod pezpallet_utility;
|
||||
pub mod pezpallet_xcm;
|
||||
pub mod paritydb_weights;
|
||||
pub mod rocksdb_weights;
|
||||
pub mod xcm;
|
||||
|
||||
|
||||
@@ -27,10 +27,10 @@ use pezframe_support::{
|
||||
},
|
||||
};
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezpallet_collator_selection::StakingPotAccountId;
|
||||
use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough};
|
||||
use pezkuwi_runtime_common::xcm_sender::ExponentialPrice;
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use pezpallet_collator_selection::StakingPotAccountId;
|
||||
use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough};
|
||||
use teyrchains_common::xcm_config::{
|
||||
AliasAccountId32FromSiblingSystemChain, AllSiblingSystemTeyrchains, ConcreteAssetFromSystem,
|
||||
ParentRelayOrSiblingTeyrchains, RelayOrOtherSystemTeyrchains,
|
||||
|
||||
@@ -39,8 +39,8 @@ pub mod fee {
|
||||
},
|
||||
};
|
||||
use pezkuwi_core_primitives::Balance;
|
||||
use smallvec::smallvec;
|
||||
pub use pezsp_runtime::Perbill;
|
||||
use smallvec::smallvec;
|
||||
|
||||
/// The block saturation level. Fees will be updates based on this value.
|
||||
pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25);
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
pub mod account {
|
||||
use pezframe_support::PalletId;
|
||||
|
||||
/// Zagros treasury pezpallet id, used to convert into AccountId - in Zagros as a destination for
|
||||
/// slashed funds.
|
||||
/// Zagros treasury pezpallet id, used to convert into AccountId - in Zagros as a destination
|
||||
/// for slashed funds.
|
||||
pub const ZAGROS_TREASURY_PALLET_ID: PalletId = PalletId(*b"py/trsry");
|
||||
/// Alliance pezpallet ID - used as a temporary place to deposit a slashed imbalance before the
|
||||
/// teleport to the Treasury.
|
||||
@@ -62,8 +62,8 @@ pub mod fee {
|
||||
},
|
||||
};
|
||||
use pezkuwi_core_primitives::Balance;
|
||||
use smallvec::smallvec;
|
||||
pub use pezsp_runtime::Perbill;
|
||||
use smallvec::smallvec;
|
||||
|
||||
/// The block saturation level. Fees will be updated based on this value.
|
||||
pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25);
|
||||
|
||||
@@ -27,10 +27,10 @@ use pezframe_support::{
|
||||
},
|
||||
};
|
||||
use pezframe_system::Pezpallet as System;
|
||||
use pezkuwichain_runtime_constants::system_teyrchain::coretime;
|
||||
use pezpallet_broker::{
|
||||
CoreAssignment, CoreIndex, CoretimeInterface, PartsOf57600, RCBlockNumberOf, TaskId,
|
||||
};
|
||||
use pezkuwichain_runtime_constants::system_teyrchain::coretime;
|
||||
use pezsp_runtime::traits::{AccountIdConversion, MaybeConvert};
|
||||
use teyrchains_common::{AccountId, Balance};
|
||||
use xcm::latest::prelude::*;
|
||||
|
||||
@@ -55,8 +55,8 @@ use pezframe_system::{
|
||||
limits::{BlockLength, BlockWeights},
|
||||
EnsureRoot,
|
||||
};
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
use pezkuwi_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
use pezsp_api::impl_runtime_apis;
|
||||
use pezsp_core::{crypto::KeyTypeId, OpaqueMetadata};
|
||||
#[cfg(any(feature = "std", test))]
|
||||
@@ -401,7 +401,8 @@ impl pezpallet_session::Config for Runtime {
|
||||
// we don't have stash and controller, thus we don't need the convert as well.
|
||||
type ValidatorIdOf = pezpallet_collator_selection::IdentityCollator;
|
||||
type ShouldEndSession = pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type NextSessionRotation = pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type NextSessionRotation =
|
||||
pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type SessionManager = CollatorSelection;
|
||||
// Essentially just Aura, but let's be pedantic.
|
||||
type SessionHandler = <SessionKeys as pezsp_runtime::traits::OpaqueKeys>::KeyTypeIdProviders;
|
||||
|
||||
@@ -18,10 +18,11 @@
|
||||
//! Expose the auto generated weight files.
|
||||
|
||||
pub mod block_weights;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod paritydb_weights;
|
||||
pub mod pezcumulus_pezpallet_teyrchain_system;
|
||||
pub mod pezcumulus_pezpallet_weight_reclaim;
|
||||
pub mod pezcumulus_pezpallet_xcmp_queue;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod pezframe_system;
|
||||
pub mod pezframe_system_extensions;
|
||||
pub mod pezpallet_balances;
|
||||
@@ -35,7 +36,6 @@ pub mod pezpallet_timestamp;
|
||||
pub mod pezpallet_transaction_payment;
|
||||
pub mod pezpallet_utility;
|
||||
pub mod pezpallet_xcm;
|
||||
pub mod paritydb_weights;
|
||||
pub mod rocksdb_weights;
|
||||
pub mod xcm;
|
||||
|
||||
|
||||
@@ -20,17 +20,17 @@ use super::{
|
||||
TransactionByteFee, WeightToFee, XcmpQueue,
|
||||
};
|
||||
use pezframe_support::{
|
||||
pezpallet_prelude::PalletInfoAccess,
|
||||
parameter_types,
|
||||
pezpallet_prelude::PalletInfoAccess,
|
||||
traits::{
|
||||
tokens::imbalance::ResolveTo, ConstU32, Contains, Disabled, Equals, Everything, Nothing,
|
||||
},
|
||||
};
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezpallet_collator_selection::StakingPotAccountId;
|
||||
use pezpallet_xcm::XcmPassthrough;
|
||||
use pezkuwi_runtime_common::xcm_sender::ExponentialPrice;
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use pezpallet_collator_selection::StakingPotAccountId;
|
||||
use pezpallet_xcm::XcmPassthrough;
|
||||
use pezsp_runtime::traits::AccountIdConversion;
|
||||
use teyrchains_common::{
|
||||
xcm_config::{
|
||||
|
||||
@@ -55,8 +55,8 @@ use pezframe_system::{
|
||||
limits::{BlockLength, BlockWeights},
|
||||
EnsureRoot,
|
||||
};
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
use pezkuwi_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
use pezsp_api::impl_runtime_apis;
|
||||
use pezsp_core::{crypto::KeyTypeId, OpaqueMetadata};
|
||||
#[cfg(any(feature = "std", test))]
|
||||
@@ -399,7 +399,8 @@ impl pezpallet_session::Config for Runtime {
|
||||
// we don't have stash and controller, thus we don't need the convert as well.
|
||||
type ValidatorIdOf = pezpallet_collator_selection::IdentityCollator;
|
||||
type ShouldEndSession = pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type NextSessionRotation = pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type NextSessionRotation =
|
||||
pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type SessionManager = CollatorSelection;
|
||||
// Essentially just Aura, but let's be pedantic.
|
||||
type SessionHandler = <SessionKeys as pezsp_runtime::traits::OpaqueKeys>::KeyTypeIdProviders;
|
||||
|
||||
@@ -18,10 +18,11 @@
|
||||
//! Expose the auto generated weight files.
|
||||
|
||||
pub mod block_weights;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod paritydb_weights;
|
||||
pub mod pezcumulus_pezpallet_teyrchain_system;
|
||||
pub mod pezcumulus_pezpallet_weight_reclaim;
|
||||
pub mod pezcumulus_pezpallet_xcmp_queue;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod pezframe_system;
|
||||
pub mod pezframe_system_extensions;
|
||||
pub mod pezpallet_balances;
|
||||
@@ -35,7 +36,6 @@ pub mod pezpallet_timestamp;
|
||||
pub mod pezpallet_transaction_payment;
|
||||
pub mod pezpallet_utility;
|
||||
pub mod pezpallet_xcm;
|
||||
pub mod paritydb_weights;
|
||||
pub mod rocksdb_weights;
|
||||
pub mod xcm;
|
||||
|
||||
|
||||
@@ -20,18 +20,18 @@ use super::{
|
||||
TeyrchainInfo, TeyrchainSystem, TransactionByteFee, WeightToFee, XcmpQueue,
|
||||
};
|
||||
use pezframe_support::{
|
||||
pezpallet_prelude::PalletInfoAccess,
|
||||
parameter_types,
|
||||
pezpallet_prelude::PalletInfoAccess,
|
||||
traits::{
|
||||
fungible::HoldConsideration, tokens::imbalance::ResolveTo, ConstU32, Contains, Equals,
|
||||
Everything, LinearStoragePrice, Nothing,
|
||||
},
|
||||
};
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezpallet_collator_selection::StakingPotAccountId;
|
||||
use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough};
|
||||
use pezkuwi_runtime_common::xcm_sender::ExponentialPrice;
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use pezpallet_collator_selection::StakingPotAccountId;
|
||||
use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough};
|
||||
use pezsp_runtime::traits::AccountIdConversion;
|
||||
use testnet_teyrchains_constants::zagros::locations::AssetHubLocation;
|
||||
use teyrchains_common::{
|
||||
|
||||
+1
-1
@@ -22,9 +22,9 @@
|
||||
|
||||
use crate::*;
|
||||
use alloc::{vec, vec::Vec};
|
||||
use hex_literal::hex;
|
||||
use pezcumulus_primitives_core::ParaId;
|
||||
use pezframe_support::build_struct_json_patch;
|
||||
use hex_literal::hex;
|
||||
use pezsp_core::{crypto::UncheckedInto, H256};
|
||||
use pezsp_genesis_builder::PresetId;
|
||||
use pezsp_keyring::Sr25519Keyring;
|
||||
|
||||
@@ -48,8 +48,8 @@ use pezframe_system::{
|
||||
limits::{BlockLength, BlockWeights},
|
||||
EnsureRoot,
|
||||
};
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
use pezkuwi_runtime_common::{identity_migrator, BlockHashCount, SlowAdjustingFeeUpdate};
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
use pezsp_api::impl_runtime_apis;
|
||||
pub use pezsp_consensus_aura::sr25519::AuthorityId as AuraId;
|
||||
use pezsp_core::{crypto::KeyTypeId, OpaqueMetadata};
|
||||
@@ -359,7 +359,8 @@ pub type RootOrFellows = EitherOfDiverse<
|
||||
|
||||
/// Root VEYA Serok (Cumhurbaşkanı) yetkisi
|
||||
/// Kullanım: Yüksek düzey yönetim kararları, atamalar
|
||||
pub type RootOrSerok = EitherOfDiverse<EnsureRoot<AccountId>, pezpallet_welati::EnsureSerok<Runtime>>;
|
||||
pub type RootOrSerok =
|
||||
EitherOfDiverse<EnsureRoot<AccountId>, pezpallet_welati::EnsureSerok<Runtime>>;
|
||||
|
||||
/// Root VEYA Parlamento üyesi yetkisi
|
||||
/// Kullanım: Yasama işlemleri, bütçe onayları
|
||||
@@ -368,7 +369,8 @@ pub type RootOrParliament =
|
||||
|
||||
/// Root VEYA Divan (Anayasa Mahkemesi) yetkisi
|
||||
/// Kullanım: Anayasal kararlar, vatandaşlık işlemleri
|
||||
pub type RootOrDiwan = EitherOfDiverse<EnsureRoot<AccountId>, pezpallet_welati::EnsureDiwan<Runtime>>;
|
||||
pub type RootOrDiwan =
|
||||
EitherOfDiverse<EnsureRoot<AccountId>, pezpallet_welati::EnsureDiwan<Runtime>>;
|
||||
|
||||
/// Root VEYA Council (Genel Konsey) yetkisi
|
||||
/// Kullanım: Genel yönetişim kararları
|
||||
@@ -446,7 +448,8 @@ impl pezpallet_session::Config for Runtime {
|
||||
// we don't have stash and controller, thus we don't need the convert as well.
|
||||
type ValidatorIdOf = pezpallet_collator_selection::IdentityCollator;
|
||||
type ShouldEndSession = pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type NextSessionRotation = pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type NextSessionRotation =
|
||||
pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type SessionManager = CollatorSelection;
|
||||
// Essentially just Aura, but let's be pedantic.
|
||||
type SessionHandler = <SessionKeys as pezsp_runtime::traits::OpaqueKeys>::KeyTypeIdProviders;
|
||||
|
||||
@@ -25,11 +25,11 @@ use pezframe_support::{
|
||||
};
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezpallet_identity::{Data, IdentityInformationProvider};
|
||||
use scale_info::TypeInfo;
|
||||
use pezsp_runtime::{
|
||||
traits::{AccountIdConversion, ConvertInto, Verify},
|
||||
RuntimeDebug,
|
||||
};
|
||||
use scale_info::TypeInfo;
|
||||
use testnet_teyrchains_constants::pezkuwichain::currency::UNITS;
|
||||
use teyrchains_common::{impls::ToParentTreasury, DAYS, HOURS};
|
||||
|
||||
|
||||
@@ -16,12 +16,14 @@
|
||||
//! Expose the auto generated weight files.
|
||||
|
||||
pub mod block_weights;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod paritydb_weights;
|
||||
pub mod pezcumulus_pezpallet_teyrchain_system;
|
||||
pub mod pezcumulus_pezpallet_weight_reclaim;
|
||||
pub mod pezcumulus_pezpallet_xcmp_queue;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod pezframe_system;
|
||||
pub mod pezframe_system_extensions;
|
||||
pub mod pezkuwi_runtime_common_identity_migrator;
|
||||
pub mod pezpallet_assets;
|
||||
pub mod pezpallet_balances;
|
||||
pub mod pezpallet_collator_selection;
|
||||
@@ -35,8 +37,6 @@ pub mod pezpallet_timestamp;
|
||||
pub mod pezpallet_transaction_payment;
|
||||
pub mod pezpallet_utility;
|
||||
pub mod pezpallet_xcm;
|
||||
pub mod paritydb_weights;
|
||||
pub mod pezkuwi_runtime_common_identity_migrator;
|
||||
pub mod rocksdb_weights;
|
||||
pub mod xcm;
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@ use pezframe_support::{
|
||||
},
|
||||
};
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use pezpallet_collator_selection::StakingPotAccountId;
|
||||
use pezpallet_xcm::XcmPassthrough;
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use pezsp_runtime::traits::AccountIdConversion;
|
||||
use teyrchains_common::{
|
||||
xcm_config::{
|
||||
|
||||
@@ -45,8 +45,8 @@ use pezframe_system::{
|
||||
limits::{BlockLength, BlockWeights},
|
||||
EnsureRoot,
|
||||
};
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
use pezkuwi_runtime_common::{identity_migrator, BlockHashCount, SlowAdjustingFeeUpdate};
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
use pezsp_api::impl_runtime_apis;
|
||||
pub use pezsp_consensus_aura::sr25519::AuthorityId as AuraId;
|
||||
use pezsp_core::{crypto::KeyTypeId, OpaqueMetadata};
|
||||
@@ -363,7 +363,8 @@ impl pezpallet_session::Config for Runtime {
|
||||
// we don't have stash and controller, thus we don't need the convert as well.
|
||||
type ValidatorIdOf = pezpallet_collator_selection::IdentityCollator;
|
||||
type ShouldEndSession = pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type NextSessionRotation = pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type NextSessionRotation =
|
||||
pezpallet_session::PeriodicSessions<ConstU32<PERIOD>, ConstU32<OFFSET>>;
|
||||
type SessionManager = CollatorSelection;
|
||||
// Essentially just Aura, but let's be pedantic.
|
||||
type SessionHandler = <SessionKeys as pezsp_runtime::traits::OpaqueKeys>::KeyTypeIdProviders;
|
||||
|
||||
@@ -22,11 +22,11 @@ use pezframe_support::{
|
||||
RuntimeDebugNoBound,
|
||||
};
|
||||
use pezpallet_identity::{Data, IdentityInformationProvider};
|
||||
use scale_info::TypeInfo;
|
||||
use pezsp_runtime::{
|
||||
traits::{AccountIdConversion, Verify},
|
||||
RuntimeDebug,
|
||||
};
|
||||
use scale_info::TypeInfo;
|
||||
use teyrchains_common::{impls::ToParentTreasury, DAYS};
|
||||
|
||||
parameter_types! {
|
||||
|
||||
@@ -16,12 +16,14 @@
|
||||
//! Expose the auto generated weight files.
|
||||
|
||||
pub mod block_weights;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod paritydb_weights;
|
||||
pub mod pezcumulus_pezpallet_teyrchain_system;
|
||||
pub mod pezcumulus_pezpallet_weight_reclaim;
|
||||
pub mod pezcumulus_pezpallet_xcmp_queue;
|
||||
pub mod extrinsic_weights;
|
||||
pub mod pezframe_system;
|
||||
pub mod pezframe_system_extensions;
|
||||
pub mod pezkuwi_runtime_common_identity_migrator;
|
||||
pub mod pezpallet_balances;
|
||||
pub mod pezpallet_collator_selection;
|
||||
pub mod pezpallet_identity;
|
||||
@@ -34,8 +36,6 @@ pub mod pezpallet_timestamp;
|
||||
pub mod pezpallet_transaction_payment;
|
||||
pub mod pezpallet_utility;
|
||||
pub mod pezpallet_xcm;
|
||||
pub mod paritydb_weights;
|
||||
pub mod pezkuwi_runtime_common_identity_migrator;
|
||||
pub mod rocksdb_weights;
|
||||
pub mod xcm;
|
||||
|
||||
|
||||
@@ -27,9 +27,9 @@ use pezframe_support::{
|
||||
},
|
||||
};
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use pezpallet_collator_selection::StakingPotAccountId;
|
||||
use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough};
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use pezsp_runtime::traits::AccountIdConversion;
|
||||
use testnet_teyrchains_constants::zagros::locations::AssetHubLocation;
|
||||
use teyrchains_common::{
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
#![cfg(test)]
|
||||
|
||||
use pezframe_support::{assert_err, assert_ok};
|
||||
use people_zagros_runtime::{
|
||||
xcm_config::{GovernanceLocation, LocationToAccountId},
|
||||
Block, Runtime, RuntimeCall, RuntimeOrigin,
|
||||
};
|
||||
use pezframe_support::{assert_err, assert_ok};
|
||||
use pezsp_core::crypto::Ss58Codec;
|
||||
use pezsp_runtime::Either;
|
||||
use testnet_teyrchains_constants::zagros::fee::WeightToFee;
|
||||
|
||||
@@ -83,8 +83,8 @@ impl<Runtime: pezframe_system::Config + pezpallet_balances::Config + pezpallet_s
|
||||
}
|
||||
}
|
||||
|
||||
impl<Runtime: pezframe_system::Config + pezpallet_balances::Config + pezpallet_session::Config> Default
|
||||
for CollatorSessionKeys<Runtime>
|
||||
impl<Runtime: pezframe_system::Config + pezpallet_balances::Config + pezpallet_session::Config>
|
||||
Default for CollatorSessionKeys<Runtime>
|
||||
{
|
||||
fn default() -> Self {
|
||||
Self { items: vec![] }
|
||||
@@ -237,9 +237,12 @@ impl<Runtime: BasicTeyrchainRuntime> ExtBuilder<Runtime> {
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
pezpallet_balances::GenesisConfig::<Runtime> { balances: self.balances, ..Default::default() }
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
pezpallet_balances::GenesisConfig::<Runtime> {
|
||||
balances: self.balances,
|
||||
..Default::default()
|
||||
}
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
|
||||
pezpallet_collator_selection::GenesisConfig::<Runtime> {
|
||||
invulnerables: self.collators.clone(),
|
||||
@@ -269,7 +272,9 @@ pub struct RuntimeHelper<Runtime, AllPalletsWithoutSystem>(
|
||||
/// Utility function that advances the chain to the desired block number.
|
||||
/// If an author is provided, that author information is injected to all the blocks in the meantime.
|
||||
impl<
|
||||
Runtime: pezframe_system::Config + pezcumulus_pezpallet_teyrchain_system::Config + pezpallet_timestamp::Config,
|
||||
Runtime: pezframe_system::Config
|
||||
+ pezcumulus_pezpallet_teyrchain_system::Config
|
||||
+ pezpallet_timestamp::Config,
|
||||
AllPalletsWithoutSystem,
|
||||
> RuntimeHelper<Runtime, AllPalletsWithoutSystem>
|
||||
where
|
||||
@@ -356,14 +361,15 @@ where
|
||||
let (inherent_data, downward_messages, horizontal_messages) =
|
||||
deconstruct_teyrchain_inherent_data(inherent_data);
|
||||
|
||||
let _ = pezcumulus_pezpallet_teyrchain_system::Pezpallet::<Runtime>::set_validation_data(
|
||||
Runtime::RuntimeOrigin::none(),
|
||||
inherent_data,
|
||||
InboundMessagesData::new(
|
||||
downward_messages.into_abridged(&mut usize::MAX.clone()),
|
||||
horizontal_messages.into_abridged(&mut usize::MAX.clone()),
|
||||
),
|
||||
);
|
||||
let _ =
|
||||
pezcumulus_pezpallet_teyrchain_system::Pezpallet::<Runtime>::set_validation_data(
|
||||
Runtime::RuntimeOrigin::none(),
|
||||
inherent_data,
|
||||
InboundMessagesData::new(
|
||||
downward_messages.into_abridged(&mut usize::MAX.clone()),
|
||||
horizontal_messages.into_abridged(&mut usize::MAX.clone()),
|
||||
),
|
||||
);
|
||||
let _ = pezpallet_timestamp::Pezpallet::<Runtime>::set(
|
||||
Runtime::RuntimeOrigin::none(),
|
||||
300_u32.into(),
|
||||
|
||||
@@ -60,9 +60,8 @@ use pezframe_support::{
|
||||
construct_runtime, derive_impl,
|
||||
dispatch::DispatchClass,
|
||||
genesis_builder_helper::{build_state, get_preset},
|
||||
ord_parameter_types,
|
||||
ord_parameter_types, parameter_types,
|
||||
pezpallet_prelude::Weight,
|
||||
parameter_types,
|
||||
traits::{
|
||||
tokens::{fungible, fungibles, imbalance::ResolveAssetTo},
|
||||
AsEnsureOriginWithArg, ConstBool, ConstU128, ConstU32, ConstU64, ConstU8, Everything,
|
||||
@@ -78,9 +77,8 @@ use pezframe_system::{
|
||||
limits::{BlockLength, BlockWeights},
|
||||
EnsureRoot, EnsureSigned, EnsureSignedBy,
|
||||
};
|
||||
use pezpallet_revive::evm::runtime::EthExtra;
|
||||
use pezkuwi_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};
|
||||
use smallvec::smallvec;
|
||||
use pezpallet_revive::evm::runtime::EthExtra;
|
||||
use pezsp_api::impl_runtime_apis;
|
||||
pub use pezsp_consensus_aura::sr25519::AuthorityId as AuraId;
|
||||
use pezsp_core::{crypto::KeyTypeId, OpaqueMetadata};
|
||||
@@ -91,6 +89,7 @@ use pezsp_runtime::{
|
||||
ApplyExtrinsicResult, FixedU128,
|
||||
};
|
||||
pub use pezsp_runtime::{traits::ConvertInto, MultiAddress, Perbill, Permill};
|
||||
use smallvec::smallvec;
|
||||
use testnet_teyrchains_constants::zagros::{consensus::*, time::*};
|
||||
use teyrchains_common::{
|
||||
impls::{AssetsToBlockAuthor, NonZeroIssuance},
|
||||
|
||||
@@ -53,9 +53,9 @@ use pezframe_support::{
|
||||
weights::Weight,
|
||||
};
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough};
|
||||
use pezkuwi_runtime_common::{impls::ToAuthor, xcm_sender::ExponentialPrice};
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use pezpallet_xcm::{AuthorizedAliasers, XcmPassthrough};
|
||||
use pezsp_runtime::traits::{AccountIdConversion, ConvertInto, Identity, TryConvertInto};
|
||||
use testnet_teyrchains_constants::zagros::currency::deposit;
|
||||
use teyrchains_common::{
|
||||
@@ -448,7 +448,12 @@ pub type ForeignAssetFeeAsExistentialDepositMultiplierFeeCharger =
|
||||
AssetFeeAsExistentialDepositMultiplier<
|
||||
Runtime,
|
||||
WeightToFee,
|
||||
pezpallet_assets::BalanceToAssetBalance<Balances, Runtime, ConvertInto, ForeignAssetsInstance>,
|
||||
pezpallet_assets::BalanceToAssetBalance<
|
||||
Balances,
|
||||
Runtime,
|
||||
ConvertInto,
|
||||
ForeignAssetsInstance,
|
||||
>,
|
||||
ForeignAssetsInstance,
|
||||
>;
|
||||
|
||||
|
||||
@@ -85,8 +85,8 @@ use xcm_builder::{
|
||||
use xcm_executor::traits::JustTry;
|
||||
|
||||
// XCM imports
|
||||
use pezpallet_xcm::{EnsureXcm, IsMajorityOfBody, XcmPassthrough};
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use pezpallet_xcm::{EnsureXcm, IsMajorityOfBody, XcmPassthrough};
|
||||
use xcm::latest::{prelude::*, PEZKUWICHAIN_GENESIS_HASH};
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom,
|
||||
@@ -702,7 +702,8 @@ pub struct RemoveCollectiveFlip;
|
||||
impl pezframe_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip {
|
||||
fn on_runtime_upgrade() -> Weight {
|
||||
use pezframe_support::storage::migration;
|
||||
// Remove the storage value `RandomMaterial` from removed pezpallet `RandomnessCollectiveFlip`
|
||||
// Remove the storage value `RandomMaterial` from removed pezpallet
|
||||
// `RandomnessCollectiveFlip`
|
||||
#[allow(deprecated)]
|
||||
migration::remove_storage_prefix(b"RandomnessCollectiveFlip", b"RandomMaterial", b"");
|
||||
<Runtime as pezframe_system::Config>::DbWeight::get().writes(1)
|
||||
|
||||
@@ -28,8 +28,8 @@ mod xcm_config;
|
||||
|
||||
use crate::xcm_config::{RelayLocation, XcmOriginToTransactDispatchOrigin};
|
||||
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
pub use pezkuwi_sdk::{pezstaging_teyrchain_info as teyrchain_info, *};
|
||||
use pezpallet_xcm::{EnsureXcm, IsVoiceOfBody};
|
||||
use pezstaging_xcm_builder as xcm_builder;
|
||||
use pezstaging_xcm_executor as xcm_executor;
|
||||
|
||||
@@ -586,7 +586,8 @@ pub struct RemoveCollectiveFlip;
|
||||
impl pezframe_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip {
|
||||
fn on_runtime_upgrade() -> Weight {
|
||||
use pezframe_support::storage::migration;
|
||||
// Remove the storage value `RandomMaterial` from removed pezpallet `RandomnessCollectiveFlip`
|
||||
// Remove the storage value `RandomMaterial` from removed pezpallet
|
||||
// `RandomnessCollectiveFlip`
|
||||
#[allow(deprecated)]
|
||||
migration::remove_storage_prefix(b"RandomnessCollectiveFlip", b"RandomMaterial", b"");
|
||||
<Runtime as pezframe_system::Config>::DbWeight::get().writes(1)
|
||||
|
||||
@@ -20,7 +20,8 @@ use super::{
|
||||
};
|
||||
|
||||
use pezkuwi_sdk::{
|
||||
pezstaging_xcm as xcm, pezstaging_xcm_builder as xcm_builder, pezstaging_xcm_executor as xcm_executor, *,
|
||||
pezstaging_xcm as xcm, pezstaging_xcm_builder as xcm_builder,
|
||||
pezstaging_xcm_executor as xcm_executor, *,
|
||||
};
|
||||
|
||||
use pezframe_support::{
|
||||
@@ -29,9 +30,9 @@ use pezframe_support::{
|
||||
weights::Weight,
|
||||
};
|
||||
use pezframe_system::EnsureRoot;
|
||||
use pezpallet_xcm::XcmPassthrough;
|
||||
use pezkuwi_runtime_common::impls::ToAuthor;
|
||||
use pezkuwi_teyrchain_primitives::primitives::Sibling;
|
||||
use pezpallet_xcm::XcmPassthrough;
|
||||
use xcm::latest::prelude::*;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom,
|
||||
|
||||
Reference in New Issue
Block a user