feat: Rebrand Polkadot/Substrate references to PezkuwiChain
This commit systematically rebrands various references from Parity Technologies' Polkadot/Substrate ecosystem to PezkuwiChain within the kurdistan-sdk. Key changes include: - Updated external repository URLs (zombienet-sdk, parity-db, parity-scale-codec, wasm-instrument) to point to pezkuwichain forks. - Modified internal documentation and code comments to reflect PezkuwiChain naming and structure. - Replaced direct references to with or specific paths within the for XCM, Pezkuwi, and other modules. - Cleaned up deprecated issue and PR references in various and files, particularly in and modules. - Adjusted image and logo URLs in documentation to point to PezkuwiChain assets. - Removed or rephrased comments related to external Polkadot/Substrate PRs and issues. This is a significant step towards fully customizing the SDK for the PezkuwiChain ecosystem.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "pallet-bridge-relayers"
|
||||
name = "pezpallet-bridge-relayers"
|
||||
description = "Module used to store relayer rewards and coordinate relayers set."
|
||||
version = "0.7.0"
|
||||
authors.workspace = true
|
||||
@@ -20,26 +20,26 @@ bp-header-chain = { workspace = true }
|
||||
bp-messages = { workspace = true }
|
||||
bp-relayers = { workspace = true }
|
||||
bp-runtime = { workspace = true }
|
||||
pallet-bridge-grandpa = { workspace = true }
|
||||
pallet-bridge-messages = { workspace = true }
|
||||
pallet-bridge-teyrchains = { workspace = true }
|
||||
pezpallet-bridge-grandpa = { workspace = true }
|
||||
pezpallet-bridge-messages = { workspace = true }
|
||||
pezpallet-bridge-teyrchains = { workspace = true }
|
||||
|
||||
# Substrate Dependencies
|
||||
frame-benchmarking = { optional = true, workspace = true }
|
||||
frame-support = { workspace = true }
|
||||
frame-system = { workspace = true }
|
||||
pallet-transaction-payment = { workspace = true }
|
||||
sp-arithmetic = { workspace = true }
|
||||
sp-runtime = { workspace = true }
|
||||
# Bizinikiwi Dependencies
|
||||
pezframe-benchmarking = { optional = true, workspace = true }
|
||||
pezframe-support = { workspace = true }
|
||||
pezframe-system = { workspace = true }
|
||||
pezpallet-transaction-payment = { workspace = true }
|
||||
pezsp-arithmetic = { workspace = true }
|
||||
pezsp-runtime = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
bp-pezkuwi-core = { workspace = true }
|
||||
bp-test-utils = { workspace = true }
|
||||
bp-teyrchains = { workspace = true }
|
||||
pallet-balances = { workspace = true, default-features = true }
|
||||
pallet-utility = { workspace = true }
|
||||
sp-core = { workspace = true }
|
||||
sp-io = { workspace = true }
|
||||
pezpallet-balances = { workspace = true, default-features = true }
|
||||
pezpallet-utility = { workspace = true }
|
||||
pezsp-core = { workspace = true }
|
||||
pezsp-io = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
@@ -52,19 +52,19 @@ std = [
|
||||
"bp-test-utils/std",
|
||||
"bp-teyrchains/std",
|
||||
"codec/std",
|
||||
"frame-benchmarking/std",
|
||||
"frame-support/std",
|
||||
"frame-system/std",
|
||||
"pallet-bridge-grandpa/std",
|
||||
"pallet-bridge-messages/std",
|
||||
"pallet-bridge-teyrchains/std",
|
||||
"pallet-transaction-payment/std",
|
||||
"pallet-utility/std",
|
||||
"pezframe-benchmarking/std",
|
||||
"pezframe-support/std",
|
||||
"pezframe-system/std",
|
||||
"pezpallet-bridge-grandpa/std",
|
||||
"pezpallet-bridge-messages/std",
|
||||
"pezpallet-bridge-teyrchains/std",
|
||||
"pezpallet-transaction-payment/std",
|
||||
"pezpallet-utility/std",
|
||||
"scale-info/std",
|
||||
"sp-arithmetic/std",
|
||||
"sp-core/std",
|
||||
"sp-io/std",
|
||||
"sp-runtime/std",
|
||||
"pezsp-arithmetic/std",
|
||||
"pezsp-core/std",
|
||||
"pezsp-io/std",
|
||||
"pezsp-runtime/std",
|
||||
"tracing/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
@@ -75,27 +75,27 @@ runtime-benchmarks = [
|
||||
"bp-runtime/runtime-benchmarks",
|
||||
"bp-test-utils/runtime-benchmarks",
|
||||
"bp-teyrchains/runtime-benchmarks",
|
||||
"frame-benchmarking/runtime-benchmarks",
|
||||
"frame-support/runtime-benchmarks",
|
||||
"frame-system/runtime-benchmarks",
|
||||
"pallet-balances/runtime-benchmarks",
|
||||
"pallet-bridge-grandpa/runtime-benchmarks",
|
||||
"pallet-bridge-messages/runtime-benchmarks",
|
||||
"pallet-bridge-teyrchains/runtime-benchmarks",
|
||||
"pallet-transaction-payment/runtime-benchmarks",
|
||||
"pallet-utility/runtime-benchmarks",
|
||||
"sp-io/runtime-benchmarks",
|
||||
"sp-runtime/runtime-benchmarks",
|
||||
"pezframe-benchmarking/runtime-benchmarks",
|
||||
"pezframe-support/runtime-benchmarks",
|
||||
"pezframe-system/runtime-benchmarks",
|
||||
"pezpallet-balances/runtime-benchmarks",
|
||||
"pezpallet-bridge-grandpa/runtime-benchmarks",
|
||||
"pezpallet-bridge-messages/runtime-benchmarks",
|
||||
"pezpallet-bridge-teyrchains/runtime-benchmarks",
|
||||
"pezpallet-transaction-payment/runtime-benchmarks",
|
||||
"pezpallet-utility/runtime-benchmarks",
|
||||
"pezsp-io/runtime-benchmarks",
|
||||
"pezsp-runtime/runtime-benchmarks",
|
||||
]
|
||||
try-runtime = [
|
||||
"frame-support/try-runtime",
|
||||
"frame-system/try-runtime",
|
||||
"pallet-balances/try-runtime",
|
||||
"pallet-bridge-grandpa/try-runtime",
|
||||
"pallet-bridge-messages/try-runtime",
|
||||
"pallet-bridge-teyrchains/try-runtime",
|
||||
"pallet-transaction-payment/try-runtime",
|
||||
"pallet-utility/try-runtime",
|
||||
"sp-runtime/try-runtime",
|
||||
"pezframe-support/try-runtime",
|
||||
"pezframe-system/try-runtime",
|
||||
"pezpallet-balances/try-runtime",
|
||||
"pezpallet-bridge-grandpa/try-runtime",
|
||||
"pezpallet-bridge-messages/try-runtime",
|
||||
"pezpallet-bridge-teyrchains/try-runtime",
|
||||
"pezpallet-transaction-payment/try-runtime",
|
||||
"pezpallet-utility/try-runtime",
|
||||
"pezsp-runtime/try-runtime",
|
||||
]
|
||||
integrity-test = []
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
|
||||
use crate::*;
|
||||
|
||||
use frame_benchmarking::v2::*;
|
||||
use frame_support::{assert_ok, weights::Weight};
|
||||
use frame_system::RawOrigin;
|
||||
use sp_runtime::traits::One;
|
||||
use pezframe_benchmarking::v2::*;
|
||||
use pezframe_support::{assert_ok, weights::Weight};
|
||||
use pezframe_system::RawOrigin;
|
||||
use pezsp_runtime::traits::One;
|
||||
|
||||
/// Reward amount that is (hopefully) is larger than existential deposit across all chains.
|
||||
const REWARD_AMOUNT: u32 = u32::MAX;
|
||||
@@ -47,12 +47,12 @@ pub trait Config<I: 'static = ()>: crate::Config<I> {
|
||||
fn assert_last_event<T: Config<I>, I: 'static>(
|
||||
generic_event: <T as pallet::Config<I>>::RuntimeEvent,
|
||||
) {
|
||||
frame_system::Pallet::<T>::assert_last_event(generic_event.into());
|
||||
pezframe_system::Pallet::<T>::assert_last_event(generic_event.into());
|
||||
}
|
||||
|
||||
#[instance_benchmarks(
|
||||
where
|
||||
BeneficiaryOf<T, I>: From<<T as frame_system::Config>::AccountId>,
|
||||
BeneficiaryOf<T, I>: From<<T as pezframe_system::Config>::AccountId>,
|
||||
)]
|
||||
mod benchmarks {
|
||||
use super::*;
|
||||
@@ -116,7 +116,7 @@ mod benchmarks {
|
||||
#[benchmark]
|
||||
fn register() {
|
||||
let relayer: T::AccountId = whitelisted_caller();
|
||||
let valid_till = frame_system::Pallet::<T>::block_number()
|
||||
let valid_till = pezframe_system::Pallet::<T>::block_number()
|
||||
.saturating_add(crate::Pallet::<T, I>::required_registration_lease())
|
||||
.saturating_add(One::one())
|
||||
.saturating_add(One::one());
|
||||
@@ -131,14 +131,14 @@ mod benchmarks {
|
||||
#[benchmark]
|
||||
fn deregister() {
|
||||
let relayer: T::AccountId = whitelisted_caller();
|
||||
let valid_till = frame_system::Pallet::<T>::block_number()
|
||||
let valid_till = pezframe_system::Pallet::<T>::block_number()
|
||||
.saturating_add(crate::Pallet::<T, I>::required_registration_lease())
|
||||
.saturating_add(One::one())
|
||||
.saturating_add(One::one());
|
||||
T::deposit_account(relayer.clone(), crate::Pallet::<T, I>::required_stake());
|
||||
crate::Pallet::<T, I>::register(RawOrigin::Signed(relayer.clone()).into(), valid_till)
|
||||
.unwrap();
|
||||
frame_system::Pallet::<T>::set_block_number(valid_till.saturating_add(One::one()));
|
||||
pezframe_system::Pallet::<T>::set_block_number(valid_till.saturating_add(One::one()));
|
||||
|
||||
#[extrinsic_call]
|
||||
_(RawOrigin::Signed(relayer.clone()));
|
||||
@@ -153,7 +153,7 @@ mod benchmarks {
|
||||
fn slash_and_deregister() {
|
||||
// prepare and register relayer account
|
||||
let relayer: T::AccountId = whitelisted_caller();
|
||||
let valid_till = frame_system::Pallet::<T>::block_number()
|
||||
let valid_till = pezframe_system::Pallet::<T>::block_number()
|
||||
.saturating_add(crate::Pallet::<T, I>::required_registration_lease())
|
||||
.saturating_add(One::one())
|
||||
.saturating_add(One::one());
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Adapter that allows using `pallet-bridge-relayers` as a signed extension in the
|
||||
//! Adapter that allows using `pezpallet-bridge-relayers` as a signed extension in the
|
||||
//! bridge with remote GRANDPA chain.
|
||||
|
||||
use crate::{
|
||||
@@ -24,16 +24,16 @@ use crate::{
|
||||
use bp_relayers::{BatchCallUnpacker, ExtensionCallData, ExtensionCallInfo, ExtensionConfig};
|
||||
use bp_runtime::{Chain, StaticStrProvider};
|
||||
use core::marker::PhantomData;
|
||||
use frame_support::dispatch::{DispatchInfo, PostDispatchInfo};
|
||||
use frame_system::Config as SystemConfig;
|
||||
use pallet_bridge_grandpa::{
|
||||
use pezframe_support::dispatch::{DispatchInfo, PostDispatchInfo};
|
||||
use pezframe_system::Config as SystemConfig;
|
||||
use pezpallet_bridge_grandpa::{
|
||||
CallSubType as BridgeGrandpaCallSubtype, Config as BridgeGrandpaConfig,
|
||||
SubmitFinalityProofHelper,
|
||||
};
|
||||
use pallet_bridge_messages::{
|
||||
use pezpallet_bridge_messages::{
|
||||
CallSubType as BridgeMessagesCallSubType, Config as BridgeMessagesConfig, LaneIdOf,
|
||||
};
|
||||
use sp_runtime::{
|
||||
use pezsp_runtime::{
|
||||
traits::{Dispatchable, Get},
|
||||
transaction_validity::{TransactionPriority, TransactionValidityError},
|
||||
Saturating,
|
||||
@@ -50,11 +50,11 @@ pub struct WithGrandpaChainExtensionConfig<
|
||||
Runtime,
|
||||
// batch call unpacker
|
||||
BatchCallUnpacker,
|
||||
// instance of the `pallet-bridge-grandpa`, tracked by this extension
|
||||
// instance of the `pezpallet-bridge-grandpa`, tracked by this extension
|
||||
BridgeGrandpaPalletInstance,
|
||||
// instance of BridgedChain `pallet-bridge-messages`, tracked by this extension
|
||||
// instance of BridgedChain `pezpallet-bridge-messages`, tracked by this extension
|
||||
BridgeMessagesPalletInstance,
|
||||
// instance of `pallet-bridge-relayers`, tracked by this extension
|
||||
// instance of `pezpallet-bridge-relayers`, tracked by this extension
|
||||
BridgeRelayersPalletInstance,
|
||||
// message delivery transaction priority boost for every additional message
|
||||
PriorityBoostPerMessage,
|
||||
@@ -75,7 +75,7 @@ impl<ID, R, BCU, GI, MI, RI, P> ExtensionConfig
|
||||
where
|
||||
ID: StaticStrProvider,
|
||||
R: BridgeRelayersConfig<RI>
|
||||
+ BridgeMessagesConfig<MI, BridgedChain = pallet_bridge_grandpa::BridgedChain<R, GI>>
|
||||
+ BridgeMessagesConfig<MI, BridgedChain = pezpallet_bridge_grandpa::BridgedChain<R, GI>>
|
||||
+ BridgeGrandpaConfig<GI>,
|
||||
BCU: BatchCallUnpacker<R>,
|
||||
GI: 'static,
|
||||
@@ -91,7 +91,7 @@ where
|
||||
type BridgeMessagesPalletInstance = MI;
|
||||
type BridgeRelayersPalletInstance = RI;
|
||||
type PriorityBoostPerMessage = P;
|
||||
type RemoteGrandpaChainBlockNumber = pallet_bridge_grandpa::BridgedBlockNumber<R, GI>;
|
||||
type RemoteGrandpaChainBlockNumber = pezpallet_bridge_grandpa::BridgedBlockNumber<R, GI>;
|
||||
type LaneId = LaneIdOf<R, Self::BridgeMessagesPalletInstance>;
|
||||
|
||||
fn parse_and_check_for_obsolete_call(
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Adapter that allows using `pallet-bridge-relayers` as a signed extension in the
|
||||
//! Adapter that allows using `pezpallet-bridge-relayers` as a signed extension in the
|
||||
//! bridge with any remote chain. This adapter does not refund any finality transactions.
|
||||
|
||||
use crate::{extension::verify_messages_call_succeeded, Config as BridgeRelayersConfig};
|
||||
@@ -22,11 +22,11 @@ use crate::{extension::verify_messages_call_succeeded, Config as BridgeRelayersC
|
||||
use bp_relayers::{ExtensionCallData, ExtensionCallInfo, ExtensionConfig};
|
||||
use bp_runtime::StaticStrProvider;
|
||||
use core::marker::PhantomData;
|
||||
use frame_support::dispatch::{DispatchInfo, PostDispatchInfo};
|
||||
use pallet_bridge_messages::{
|
||||
use pezframe_support::dispatch::{DispatchInfo, PostDispatchInfo};
|
||||
use pezpallet_bridge_messages::{
|
||||
CallSubType as BridgeMessagesCallSubType, Config as BridgeMessagesConfig, LaneIdOf,
|
||||
};
|
||||
use sp_runtime::{
|
||||
use pezsp_runtime::{
|
||||
traits::{Dispatchable, Get},
|
||||
transaction_validity::{TransactionPriority, TransactionValidityError},
|
||||
};
|
||||
@@ -43,11 +43,11 @@ pub struct WithMessagesExtensionConfig<
|
||||
PhantomData<(
|
||||
// signed extension identifier
|
||||
IdProvider,
|
||||
// runtime with `pallet-bridge-messages` pallet deployed
|
||||
// runtime with `pezpallet-bridge-messages` pallet deployed
|
||||
Runtime,
|
||||
// instance of BridgedChain `pallet-bridge-messages`, tracked by this extension
|
||||
// instance of BridgedChain `pezpallet-bridge-messages`, tracked by this extension
|
||||
BridgeMessagesPalletInstance,
|
||||
// instance of `pallet-bridge-relayers`, tracked by this extension
|
||||
// instance of `pezpallet-bridge-relayers`, tracked by this extension
|
||||
BridgeRelayersPalletInstance,
|
||||
// message delivery transaction priority boost for every additional message
|
||||
PriorityBoostPerMessage,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Signed extension, built around `pallet-bridge-relayers`. It is able to:
|
||||
//! Signed extension, built around `pezpallet-bridge-relayers`. It is able to:
|
||||
//!
|
||||
//! - refund the cost of successful message delivery and confirmation transactions to the submitter
|
||||
//! by registering corresponding reward in the pallet;
|
||||
@@ -32,21 +32,21 @@ use bp_relayers::{
|
||||
use bp_runtime::{Chain, RangeInclusiveExt, StaticStrProvider};
|
||||
use codec::{Decode, DecodeWithMemTracking, Encode};
|
||||
use core::{fmt::Debug, marker::PhantomData};
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
dispatch::{DispatchInfo, PostDispatchInfo},
|
||||
pallet_prelude::TransactionSource,
|
||||
pezpallet_prelude::TransactionSource,
|
||||
weights::Weight,
|
||||
CloneNoBound, DefaultNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound,
|
||||
};
|
||||
use frame_system::Config as SystemConfig;
|
||||
use pallet_bridge_messages::{
|
||||
use pezframe_system::Config as SystemConfig;
|
||||
use pezpallet_bridge_messages::{
|
||||
CallHelper as MessagesCallHelper, Config as BridgeMessagesConfig, LaneIdOf,
|
||||
};
|
||||
use pallet_transaction_payment::{
|
||||
use pezpallet_transaction_payment::{
|
||||
Config as TransactionPaymentConfig, OnChargeTransaction, Pallet as TransactionPaymentPallet,
|
||||
};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_runtime::{
|
||||
use pezsp_runtime::{
|
||||
traits::{
|
||||
AsSystemOriginSigner, DispatchInfoOf, Dispatchable, PostDispatchInfoOf,
|
||||
TransactionExtension, ValidateResult, Zero,
|
||||
@@ -106,13 +106,13 @@ pub enum RelayerAccountAction<AccountId, RewardBalance, LaneId> {
|
||||
Slash(AccountId, RewardsAccountParams<LaneId>),
|
||||
}
|
||||
|
||||
/// A signed extension, built around `pallet-bridge-relayers`.
|
||||
/// A signed extension, built around `pezpallet-bridge-relayers`.
|
||||
///
|
||||
/// It may be incorporated into runtime to refund relayers for submitting correct
|
||||
/// message delivery and confirmation transactions, optionally batched with required
|
||||
/// finality proofs.
|
||||
///
|
||||
/// (Works only with `pallet-bridge-messages` and `RewardsAccountParams` as the `Reward`)
|
||||
/// (Works only with `pezpallet-bridge-messages` and `RewardsAccountParams` as the `Reward`)
|
||||
#[derive(
|
||||
DefaultNoBound,
|
||||
CloneNoBound,
|
||||
@@ -467,17 +467,17 @@ mod tests {
|
||||
use bp_runtime::{BasicOperatingMode, HeaderId, Teyrchain};
|
||||
use bp_test_utils::{make_default_justification, test_keyring, TEST_GRANDPA_SET_ID};
|
||||
use bp_teyrchains::{BestParaHeadHash, ParaInfo, SubmitTeyrchainHeadsInfo};
|
||||
use frame_support::{
|
||||
__private::sp_tracing,
|
||||
use pezframe_support::{
|
||||
__private::pezsp_tracing,
|
||||
assert_storage_noop, parameter_types,
|
||||
traits::{fungible::Mutate, ReservableCurrency},
|
||||
weights::Weight,
|
||||
};
|
||||
use pallet_bridge_grandpa::{Call as GrandpaCall, Pallet as GrandpaPallet, StoredAuthoritySet};
|
||||
use pallet_bridge_messages::{Call as MessagesCall, Pallet as MessagesPallet};
|
||||
use pallet_bridge_teyrchains::{Call as TeyrchainsCall, Pallet as TeyrchainsPallet};
|
||||
use pallet_utility::Call as UtilityCall;
|
||||
use sp_runtime::{
|
||||
use pezpallet_bridge_grandpa::{Call as GrandpaCall, Pallet as GrandpaPallet, StoredAuthoritySet};
|
||||
use pezpallet_bridge_messages::{Call as MessagesCall, Pallet as MessagesPallet};
|
||||
use pezpallet_bridge_teyrchains::{Call as TeyrchainsCall, Pallet as TeyrchainsPallet};
|
||||
use pezpallet_utility::Call as UtilityCall;
|
||||
use pezsp_runtime::{
|
||||
traits::{ConstU64, DispatchTransaction, Header as HeaderT},
|
||||
transaction_validity::{
|
||||
InvalidTransaction, TransactionSource::External, TransactionValidity, ValidTransaction,
|
||||
@@ -565,11 +565,11 @@ mod tests {
|
||||
) {
|
||||
let authorities = test_keyring().into_iter().map(|(a, w)| (a.into(), w)).collect();
|
||||
let best_relay_header = HeaderId(best_relay_header_number, BridgedChainHash::default());
|
||||
pallet_bridge_grandpa::CurrentAuthoritySet::<TestRuntime>::put(
|
||||
pezpallet_bridge_grandpa::CurrentAuthoritySet::<TestRuntime>::put(
|
||||
StoredAuthoritySet::try_new(authorities, TEST_GRANDPA_SET_ID).unwrap(),
|
||||
);
|
||||
pallet_bridge_grandpa::BestFinalized::<TestRuntime>::put(best_relay_header);
|
||||
pallet_bridge_grandpa::ImportedHeaders::<TestRuntime>::insert(
|
||||
pezpallet_bridge_grandpa::BestFinalized::<TestRuntime>::put(best_relay_header);
|
||||
pezpallet_bridge_grandpa::ImportedHeaders::<TestRuntime>::insert(
|
||||
best_relay_header.hash(),
|
||||
bp_test_utils::test_header::<BridgedChainHeader>(0).build(),
|
||||
);
|
||||
@@ -582,16 +582,16 @@ mod tests {
|
||||
},
|
||||
next_imported_hash_position: 0,
|
||||
};
|
||||
pallet_bridge_teyrchains::ParasInfo::<TestRuntime>::insert(para_id, para_info);
|
||||
pezpallet_bridge_teyrchains::ParasInfo::<TestRuntime>::insert(para_id, para_info);
|
||||
|
||||
let lane_id = test_lane_id();
|
||||
let in_lane_data =
|
||||
InboundLaneData { last_confirmed_nonce: best_message, ..Default::default() };
|
||||
pallet_bridge_messages::InboundLanes::<TestRuntime>::insert(lane_id, in_lane_data);
|
||||
pezpallet_bridge_messages::InboundLanes::<TestRuntime>::insert(lane_id, in_lane_data);
|
||||
|
||||
let out_lane_data =
|
||||
OutboundLaneData { latest_received_nonce: best_message, ..Default::default() };
|
||||
pallet_bridge_messages::OutboundLanes::<TestRuntime>::insert(lane_id, out_lane_data);
|
||||
pezpallet_bridge_messages::OutboundLanes::<TestRuntime>::insert(lane_id, out_lane_data);
|
||||
|
||||
Balances::mint_into(&delivery_rewards_account(), ExistentialDeposit::get()).unwrap();
|
||||
Balances::mint_into(&confirmation_rewards_account(), ExistentialDeposit::get()).unwrap();
|
||||
@@ -670,7 +670,7 @@ mod tests {
|
||||
bridged_header_hash: Default::default(),
|
||||
storage_proof: Default::default(),
|
||||
lane: test_lane_id(),
|
||||
nonces_start: pallet_bridge_messages::InboundLanes::<TestRuntime>::get(
|
||||
nonces_start: pezpallet_bridge_messages::InboundLanes::<TestRuntime>::get(
|
||||
test_lane_id(),
|
||||
)
|
||||
.unwrap()
|
||||
@@ -1137,7 +1137,7 @@ mod tests {
|
||||
Option<PreDispatchData<ThisChainAccountId, BridgedChainBlockNumber, TestLaneIdType>>,
|
||||
TransactionValidityError,
|
||||
> {
|
||||
sp_tracing::try_init_simple();
|
||||
pezsp_tracing::try_init_simple();
|
||||
let extension: TestExtension = BridgeRelayersTransactionExtension(PhantomData);
|
||||
extension
|
||||
.validate_and_prepare(
|
||||
@@ -1189,17 +1189,17 @@ mod tests {
|
||||
fn dispatch_info() -> DispatchInfo {
|
||||
DispatchInfo {
|
||||
call_weight: Weight::from_parts(
|
||||
frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND,
|
||||
pezframe_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND,
|
||||
0,
|
||||
),
|
||||
extension_weight: Weight::zero(),
|
||||
class: frame_support::dispatch::DispatchClass::Normal,
|
||||
pays_fee: frame_support::dispatch::Pays::Yes,
|
||||
class: pezframe_support::dispatch::DispatchClass::Normal,
|
||||
pays_fee: pezframe_support::dispatch::Pays::Yes,
|
||||
}
|
||||
}
|
||||
|
||||
fn post_dispatch_info() -> PostDispatchInfo {
|
||||
PostDispatchInfo { actual_weight: None, pays_fee: frame_support::dispatch::Pays::Yes }
|
||||
PostDispatchInfo { actual_weight: None, pays_fee: pezframe_support::dispatch::Pays::Yes }
|
||||
}
|
||||
|
||||
fn run_post_dispatch(
|
||||
@@ -1223,7 +1223,7 @@ mod tests {
|
||||
let extra_weight = <TestRuntime as RelayersConfig>::WeightInfo::extra_weight_of_successful_receive_messages_proof_call();
|
||||
post_dispatch_info.actual_weight =
|
||||
Some(dispatch_info().call_weight.saturating_sub(extra_weight));
|
||||
pallet_transaction_payment::Pallet::<TestRuntime>::compute_actual_fee(
|
||||
pezpallet_transaction_payment::Pallet::<TestRuntime>::compute_actual_fee(
|
||||
1024,
|
||||
&dispatch_info(),
|
||||
&post_dispatch_info,
|
||||
@@ -1232,7 +1232,7 @@ mod tests {
|
||||
}
|
||||
|
||||
fn expected_confirmation_reward() -> RewardBalance {
|
||||
pallet_transaction_payment::Pallet::<TestRuntime>::compute_actual_fee(
|
||||
pezpallet_transaction_payment::Pallet::<TestRuntime>::compute_actual_fee(
|
||||
1024,
|
||||
&dispatch_info(),
|
||||
&post_dispatch_info(),
|
||||
@@ -1783,7 +1783,7 @@ mod tests {
|
||||
|
||||
let mut dispatch_info = dispatch_info();
|
||||
dispatch_info.call_weight = Weight::from_parts(
|
||||
frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND * 2,
|
||||
pezframe_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND * 2,
|
||||
0,
|
||||
);
|
||||
|
||||
@@ -1804,7 +1804,7 @@ mod tests {
|
||||
match pre_dispatch_data.call_info {
|
||||
ExtensionCallInfo::AllFinalityAndMsgs(ref mut info, ..) => {
|
||||
info.extra_weight.set_ref_time(
|
||||
frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND,
|
||||
pezframe_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND,
|
||||
);
|
||||
info.extra_size = 32;
|
||||
},
|
||||
@@ -2424,7 +2424,7 @@ mod tests {
|
||||
.into(),
|
||||
..Default::default()
|
||||
};
|
||||
pallet_bridge_messages::InboundLanes::<TestRuntime>::insert(lane_id, in_lane_data);
|
||||
pezpallet_bridge_messages::InboundLanes::<TestRuntime>::insert(lane_id, in_lane_data);
|
||||
|
||||
// now check that the priority of empty tx is the same as priority of 1-message tx
|
||||
let priority_of_zero_messages_delivery =
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
//! single message with nonce `N`, then the transaction with nonces `N..=N+100` will
|
||||
//! be rejected. This can lower bridge throughput down to one message per block.
|
||||
|
||||
use frame_support::traits::Get;
|
||||
use sp_runtime::transaction_validity::TransactionPriority;
|
||||
use pezframe_support::traits::Get;
|
||||
use pezsp_runtime::transaction_validity::TransactionPriority;
|
||||
|
||||
// reexport everything from `integrity_tests` module
|
||||
#[allow(unused_imports)]
|
||||
@@ -53,19 +53,19 @@ mod integrity_tests {
|
||||
|
||||
use bp_messages::MessageNonce;
|
||||
use bp_runtime::PreComputedSize;
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
dispatch::{DispatchClass, DispatchInfo, Pays, PostDispatchInfo},
|
||||
traits::Get,
|
||||
};
|
||||
use pallet_transaction_payment::OnChargeTransaction;
|
||||
use sp_runtime::{
|
||||
use pezpallet_transaction_payment::OnChargeTransaction;
|
||||
use pezsp_runtime::{
|
||||
traits::{Dispatchable, UniqueSaturatedInto, Zero},
|
||||
transaction_validity::TransactionPriority,
|
||||
FixedPointOperand, SaturatedConversion, Saturating,
|
||||
};
|
||||
|
||||
type BalanceOf<T> =
|
||||
<<T as pallet_transaction_payment::Config>::OnChargeTransaction as OnChargeTransaction<
|
||||
<<T as pezpallet_transaction_payment::Config>::OnChargeTransaction as OnChargeTransaction<
|
||||
T,
|
||||
>>::Balance;
|
||||
|
||||
@@ -145,7 +145,7 @@ mod integrity_tests {
|
||||
use bp_header_chain::{
|
||||
max_expected_submit_finality_proof_arguments_size, ChainWithGrandpa,
|
||||
};
|
||||
use pallet_bridge_grandpa::WeightInfoExt;
|
||||
use pezpallet_bridge_grandpa::WeightInfoExt;
|
||||
|
||||
/// Ensures that the value of `PriorityBoostPerHeader` matches the value of
|
||||
/// `tip_boost_per_header`.
|
||||
@@ -158,7 +158,7 @@ mod integrity_tests {
|
||||
tip_boost_per_header: BalanceOf<Runtime>,
|
||||
) where
|
||||
Runtime:
|
||||
pallet_transaction_payment::Config + pallet_bridge_grandpa::Config<GrandpaInstance>,
|
||||
pezpallet_transaction_payment::Config + pezpallet_bridge_grandpa::Config<GrandpaInstance>,
|
||||
GrandpaInstance: 'static,
|
||||
PriorityBoostPerHeader: Get<TransactionPriority>,
|
||||
Runtime::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
|
||||
@@ -190,7 +190,7 @@ mod integrity_tests {
|
||||
) -> TransactionPriority
|
||||
where
|
||||
Runtime:
|
||||
pallet_transaction_payment::Config + pallet_bridge_grandpa::Config<GrandpaInstance>,
|
||||
pezpallet_transaction_payment::Config + pezpallet_bridge_grandpa::Config<GrandpaInstance>,
|
||||
GrandpaInstance: 'static,
|
||||
Runtime::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
|
||||
BalanceOf<Runtime>: Send + Sync + FixedPointOperand,
|
||||
@@ -206,14 +206,14 @@ mod integrity_tests {
|
||||
|
||||
// finally we are able to estimate transaction size and weight
|
||||
let transaction_size = base_tx_size.saturating_add(tx_call_size);
|
||||
let transaction_weight = <Runtime as ::pallet_bridge_grandpa::Config<
|
||||
let transaction_weight = <Runtime as ::pezpallet_bridge_grandpa::Config<
|
||||
GrandpaInstance,
|
||||
>>::WeightInfo::submit_finality_proof_weight(
|
||||
Runtime::BridgedChain::MAX_AUTHORITIES_COUNT * 2 / 3 + 1,
|
||||
Runtime::BridgedChain::REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY,
|
||||
);
|
||||
|
||||
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::get_priority(
|
||||
pezpallet_transaction_payment::ChargeTransactionPayment::<Runtime>::get_priority(
|
||||
&DispatchInfo {
|
||||
call_weight: transaction_weight,
|
||||
extension_weight: Default::default(),
|
||||
@@ -232,7 +232,7 @@ mod integrity_tests {
|
||||
use super::*;
|
||||
|
||||
use bp_runtime::Teyrchain;
|
||||
use pallet_bridge_teyrchains::WeightInfoExt;
|
||||
use pezpallet_bridge_teyrchains::WeightInfoExt;
|
||||
|
||||
/// Ensures that the value of `PriorityBoostPerHeader` matches the value of
|
||||
/// `tip_boost_per_header`.
|
||||
@@ -249,8 +249,8 @@ mod integrity_tests {
|
||||
>(
|
||||
tip_boost_per_header: BalanceOf<Runtime>,
|
||||
) where
|
||||
Runtime: pallet_transaction_payment::Config
|
||||
+ pallet_bridge_teyrchains::Config<TeyrchainsInstance>,
|
||||
Runtime: pezpallet_transaction_payment::Config
|
||||
+ pezpallet_bridge_teyrchains::Config<TeyrchainsInstance>,
|
||||
TeyrchainsInstance: 'static,
|
||||
Para: Teyrchain,
|
||||
PriorityBoostPerHeader: Get<TransactionPriority>,
|
||||
@@ -288,8 +288,8 @@ mod integrity_tests {
|
||||
tip: BalanceOf<Runtime>,
|
||||
) -> TransactionPriority
|
||||
where
|
||||
Runtime: pallet_transaction_payment::Config
|
||||
+ pallet_bridge_teyrchains::Config<TeyrchainsInstance>,
|
||||
Runtime: pezpallet_transaction_payment::Config
|
||||
+ pezpallet_bridge_teyrchains::Config<TeyrchainsInstance>,
|
||||
TeyrchainsInstance: 'static,
|
||||
Para: Teyrchain,
|
||||
Runtime::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
|
||||
@@ -300,14 +300,14 @@ mod integrity_tests {
|
||||
// all call arguments except the proof itself)
|
||||
let base_tx_size = 512;
|
||||
// let's say we are relaying largest teyrchain headers and proof takes some more bytes
|
||||
let tx_call_size = <Runtime as pallet_bridge_teyrchains::Config<
|
||||
let tx_call_size = <Runtime as pezpallet_bridge_teyrchains::Config<
|
||||
TeyrchainsInstance,
|
||||
>>::WeightInfo::expected_extra_storage_proof_size()
|
||||
.saturating_add(Para::MAX_HEADER_SIZE);
|
||||
|
||||
// finally we are able to estimate transaction size and weight
|
||||
let transaction_size = base_tx_size.saturating_add(tx_call_size);
|
||||
let transaction_weight = <Runtime as pallet_bridge_teyrchains::Config<
|
||||
let transaction_weight = <Runtime as pezpallet_bridge_teyrchains::Config<
|
||||
TeyrchainsInstance,
|
||||
>>::WeightInfo::submit_teyrchain_heads_weight(
|
||||
Runtime::DbWeight::get(),
|
||||
@@ -316,7 +316,7 @@ mod integrity_tests {
|
||||
1,
|
||||
);
|
||||
|
||||
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::get_priority(
|
||||
pezpallet_transaction_payment::ChargeTransactionPayment::<Runtime>::get_priority(
|
||||
&DispatchInfo {
|
||||
call_weight: transaction_weight,
|
||||
extension_weight: Default::default(),
|
||||
@@ -335,7 +335,7 @@ mod integrity_tests {
|
||||
use super::*;
|
||||
|
||||
use bp_messages::ChainWithMessages;
|
||||
use pallet_bridge_messages::WeightInfoExt;
|
||||
use pezpallet_bridge_messages::WeightInfoExt;
|
||||
|
||||
/// Ensures that the value of `PriorityBoostPerMessage` matches the value of
|
||||
/// `tip_boost_per_message`.
|
||||
@@ -347,8 +347,8 @@ mod integrity_tests {
|
||||
pub fn ensure_priority_boost_is_sane<Runtime, MessagesInstance, PriorityBoostPerMessage>(
|
||||
tip_boost_per_message: BalanceOf<Runtime>,
|
||||
) where
|
||||
Runtime: pallet_transaction_payment::Config
|
||||
+ pallet_bridge_messages::Config<MessagesInstance>,
|
||||
Runtime: pezpallet_transaction_payment::Config
|
||||
+ pezpallet_bridge_messages::Config<MessagesInstance>,
|
||||
MessagesInstance: 'static,
|
||||
PriorityBoostPerMessage: Get<TransactionPriority>,
|
||||
Runtime::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
|
||||
@@ -375,8 +375,8 @@ mod integrity_tests {
|
||||
tip: BalanceOf<Runtime>,
|
||||
) -> TransactionPriority
|
||||
where
|
||||
Runtime: pallet_transaction_payment::Config
|
||||
+ pallet_bridge_messages::Config<MessagesInstance>,
|
||||
Runtime: pezpallet_transaction_payment::Config
|
||||
+ pezpallet_bridge_messages::Config<MessagesInstance>,
|
||||
MessagesInstance: 'static,
|
||||
Runtime::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
|
||||
BalanceOf<Runtime>: Send + Sync + FixedPointOperand,
|
||||
@@ -389,7 +389,7 @@ mod integrity_tests {
|
||||
// trie nodes to the proof (x0.5 because we expect some nodes to be reused)
|
||||
let estimated_message_size = 512;
|
||||
// let's say all our messages have the same dispatch weight
|
||||
let estimated_message_dispatch_weight = <Runtime as pallet_bridge_messages::Config<
|
||||
let estimated_message_dispatch_weight = <Runtime as pezpallet_bridge_messages::Config<
|
||||
MessagesInstance,
|
||||
>>::WeightInfo::message_dispatch_weight(
|
||||
estimated_message_size
|
||||
@@ -397,7 +397,7 @@ mod integrity_tests {
|
||||
// messages proof argument size is (for every message) messages size + some additional
|
||||
// trie nodes. Some of them are reused by different messages, so let's take 2/3 of
|
||||
// default "overhead" constant
|
||||
let messages_proof_size = <Runtime as pallet_bridge_messages::Config<
|
||||
let messages_proof_size = <Runtime as pezpallet_bridge_messages::Config<
|
||||
MessagesInstance,
|
||||
>>::WeightInfo::expected_extra_storage_proof_size()
|
||||
.saturating_mul(2)
|
||||
@@ -407,7 +407,7 @@ mod integrity_tests {
|
||||
|
||||
// finally we are able to estimate transaction size and weight
|
||||
let transaction_size = base_tx_size.saturating_add(messages_proof_size);
|
||||
let transaction_weight = <Runtime as pallet_bridge_messages::Config<
|
||||
let transaction_weight = <Runtime as pezpallet_bridge_messages::Config<
|
||||
MessagesInstance,
|
||||
>>::WeightInfo::receive_messages_proof_weight(
|
||||
&PreComputedSize(transaction_size as _),
|
||||
@@ -415,7 +415,7 @@ mod integrity_tests {
|
||||
estimated_message_dispatch_weight.saturating_mul(messages),
|
||||
);
|
||||
|
||||
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::get_priority(
|
||||
pezpallet_transaction_payment::ChargeTransactionPayment::<Runtime>::get_priority(
|
||||
&DispatchInfo {
|
||||
call_weight: transaction_weight,
|
||||
extension_weight: Default::default(),
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Adapter that allows using `pallet-bridge-relayers` as a signed extension in the
|
||||
//! Adapter that allows using `pezpallet-bridge-relayers` as a signed extension in the
|
||||
//! bridge with remote teyrchain.
|
||||
|
||||
use crate::{
|
||||
@@ -27,19 +27,19 @@ use crate::{
|
||||
use bp_relayers::{BatchCallUnpacker, ExtensionCallData, ExtensionCallInfo, ExtensionConfig};
|
||||
use bp_runtime::{StaticStrProvider, Teyrchain};
|
||||
use core::marker::PhantomData;
|
||||
use frame_support::dispatch::{DispatchInfo, PostDispatchInfo};
|
||||
use frame_system::Config as SystemConfig;
|
||||
use pallet_bridge_grandpa::{
|
||||
use pezframe_support::dispatch::{DispatchInfo, PostDispatchInfo};
|
||||
use pezframe_system::Config as SystemConfig;
|
||||
use pezpallet_bridge_grandpa::{
|
||||
CallSubType as BridgeGrandpaCallSubtype, Config as BridgeGrandpaConfig,
|
||||
};
|
||||
use pallet_bridge_messages::{
|
||||
use pezpallet_bridge_messages::{
|
||||
CallSubType as BridgeMessagesCallSubType, Config as BridgeMessagesConfig, LaneIdOf,
|
||||
};
|
||||
use pallet_bridge_teyrchains::{
|
||||
use pezpallet_bridge_teyrchains::{
|
||||
CallSubType as BridgeTeyrchainsCallSubtype, Config as BridgeTeyrchainsConfig,
|
||||
SubmitTeyrchainHeadsHelper,
|
||||
};
|
||||
use sp_runtime::{
|
||||
use pezsp_runtime::{
|
||||
traits::{Dispatchable, Get},
|
||||
transaction_validity::{TransactionPriority, TransactionValidityError},
|
||||
};
|
||||
@@ -54,11 +54,11 @@ pub struct WithTeyrchainExtensionConfig<
|
||||
Runtime,
|
||||
// batch call unpacker
|
||||
BatchCallUnpacker,
|
||||
// instance of the `pallet-bridge-teyrchains`, tracked by this extension
|
||||
// instance of the `pezpallet-bridge-teyrchains`, tracked by this extension
|
||||
BridgeTeyrchainsPalletInstance,
|
||||
// instance of BridgedChain `pallet-bridge-messages`, tracked by this extension
|
||||
// instance of BridgedChain `pezpallet-bridge-messages`, tracked by this extension
|
||||
BridgeMessagesPalletInstance,
|
||||
// instance of `pallet-bridge-relayers`, tracked by this extension
|
||||
// instance of `pezpallet-bridge-relayers`, tracked by this extension
|
||||
BridgeRelayersPalletInstance,
|
||||
// message delivery transaction priority boost for every additional message
|
||||
PriorityBoostPerMessage,
|
||||
@@ -99,7 +99,7 @@ where
|
||||
type BridgeRelayersPalletInstance = RI;
|
||||
type PriorityBoostPerMessage = P;
|
||||
type RemoteGrandpaChainBlockNumber =
|
||||
pallet_bridge_grandpa::BridgedBlockNumber<R, R::BridgesGrandpaPalletInstance>;
|
||||
pezpallet_bridge_grandpa::BridgedBlockNumber<R, R::BridgesGrandpaPalletInstance>;
|
||||
type LaneId = LaneIdOf<R, Self::BridgeMessagesPalletInstance>;
|
||||
|
||||
fn parse_and_check_for_obsolete_call(
|
||||
|
||||
@@ -25,9 +25,9 @@ pub use bp_relayers::RewardLedger;
|
||||
use bp_relayers::{PaymentProcedure, Registration, RelayerRewardsKeyProvider, StakeAndSlash};
|
||||
use bp_runtime::StorageDoubleMapKeyProvider;
|
||||
use core::marker::PhantomData;
|
||||
use frame_support::{fail, traits::tokens::Balance};
|
||||
use sp_arithmetic::traits::{AtLeast32BitUnsigned, Zero};
|
||||
use sp_runtime::{
|
||||
use pezframe_support::{fail, traits::tokens::Balance};
|
||||
use pezsp_arithmetic::traits::{AtLeast32BitUnsigned, Zero};
|
||||
use pezsp_runtime::{
|
||||
traits::{CheckedSub, IdentifyAccount},
|
||||
Saturating,
|
||||
};
|
||||
@@ -51,32 +51,32 @@ pub mod weights;
|
||||
/// The target that will be used when publishing logs related to this pallet.
|
||||
pub const LOG_TARGET: &str = "runtime::bridge-relayers";
|
||||
|
||||
#[frame_support::pallet]
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::*;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
/// `RelayerRewardsKeyProvider` for given configuration.
|
||||
type RelayerRewardsKeyProviderOf<T, I> = RelayerRewardsKeyProvider<
|
||||
<T as frame_system::Config>::AccountId,
|
||||
<T as pezframe_system::Config>::AccountId,
|
||||
<T as Config<I>>::Reward,
|
||||
<T as Config<I>>::RewardBalance,
|
||||
>;
|
||||
|
||||
/// Shortcut to alternative beneficiary type for `Config::PaymentProcedure`.
|
||||
pub type BeneficiaryOf<T, I> = <<T as Config<I>>::PaymentProcedure as PaymentProcedure<
|
||||
<T as frame_system::Config>::AccountId,
|
||||
<T as pezframe_system::Config>::AccountId,
|
||||
<T as Config<I>>::Reward,
|
||||
<T as Config<I>>::RewardBalance,
|
||||
>>::Beneficiary;
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config<I: 'static = ()>: frame_system::Config {
|
||||
pub trait Config<I: 'static = ()>: pezframe_system::Config {
|
||||
/// The overarching event type.
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: From<Event<Self, I>>
|
||||
+ IsType<<Self as frame_system::Config>::RuntimeEvent>;
|
||||
+ IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
|
||||
|
||||
/// Type of relayer reward balance.
|
||||
type RewardBalance: AtLeast32BitUnsigned + Copy + Member + Parameter + MaxEncodedLen;
|
||||
@@ -107,7 +107,7 @@ pub mod pallet {
|
||||
#[pallet::call]
|
||||
impl<T: Config<I>, I: 'static> Pallet<T, I>
|
||||
where
|
||||
BeneficiaryOf<T, I>: From<<T as frame_system::Config>::AccountId>,
|
||||
BeneficiaryOf<T, I>: From<<T as pezframe_system::Config>::AccountId>,
|
||||
{
|
||||
/// Claim accumulated rewards.
|
||||
#[pallet::call_index(0)]
|
||||
@@ -128,7 +128,7 @@ pub mod pallet {
|
||||
|
||||
// valid till must be larger than the current block number and the lease must be larger
|
||||
// than the `RequiredRegistrationLease`
|
||||
let lease = valid_till.saturating_sub(frame_system::Pallet::<T>::block_number());
|
||||
let lease = valid_till.saturating_sub(pezframe_system::Pallet::<T>::block_number());
|
||||
ensure!(
|
||||
lease > Self::required_registration_lease(),
|
||||
Error::<T, I>::InvalidRegistrationLease
|
||||
@@ -202,7 +202,7 @@ pub mod pallet {
|
||||
|
||||
// we can't deregister until `valid_till + 1`
|
||||
ensure!(
|
||||
registration.valid_till < frame_system::Pallet::<T>::block_number(),
|
||||
registration.valid_till < pezframe_system::Pallet::<T>::block_number(),
|
||||
Error::<T, I>::RegistrationIsStillActive,
|
||||
);
|
||||
|
||||
@@ -320,7 +320,7 @@ pub mod pallet {
|
||||
// registration is inactive if it ends soon
|
||||
let remaining_lease = registration
|
||||
.valid_till
|
||||
.saturating_sub(frame_system::Pallet::<T>::block_number());
|
||||
.saturating_sub(pezframe_system::Pallet::<T>::block_number());
|
||||
if remaining_lease <= Self::required_registration_lease() {
|
||||
return false;
|
||||
}
|
||||
@@ -580,9 +580,9 @@ mod tests {
|
||||
|
||||
use bp_messages::{HashedLaneId, LaneIdType};
|
||||
use bp_relayers::{RewardsAccountOwner, RewardsAccountParams};
|
||||
use frame_support::{assert_noop, assert_ok, traits::fungible::Mutate};
|
||||
use frame_system::{EventRecord, Pallet as System, Phase};
|
||||
use sp_runtime::DispatchError;
|
||||
use pezframe_support::{assert_noop, assert_ok, traits::fungible::Mutate};
|
||||
use pezframe_system::{EventRecord, Pallet as System, Phase};
|
||||
use pezsp_runtime::DispatchError;
|
||||
|
||||
fn get_ready_for_events() {
|
||||
System::<TestRuntime>::set_block_number(1);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//! A module that is responsible for migration of storage.
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
traits::{Get, StorageVersion},
|
||||
weights::Weight,
|
||||
};
|
||||
@@ -33,9 +33,9 @@ pub mod v0 {
|
||||
use bp_runtime::{ChainId, StorageDoubleMapKeyProvider};
|
||||
use codec::{Codec, Decode, Encode, EncodeLike, MaxEncodedLen};
|
||||
use core::marker::PhantomData;
|
||||
use frame_support::{pallet_prelude::OptionQuery, Blake2_128Concat, Identity};
|
||||
use pezframe_support::{pezpallet_prelude::OptionQuery, Blake2_128Concat, Identity};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_runtime::traits::AccountIdConversion;
|
||||
use pezsp_runtime::traits::AccountIdConversion;
|
||||
|
||||
/// Structure used to identify the account that pays a reward to the relayer.
|
||||
#[derive(Copy, Clone, Debug, Decode, Encode, Eq, PartialEq, TypeInfo, MaxEncodedLen)]
|
||||
@@ -59,7 +59,7 @@ pub mod v0 {
|
||||
}
|
||||
}
|
||||
|
||||
impl<LaneId> sp_runtime::TypeId for RewardsAccountParams<LaneId> {
|
||||
impl<LaneId> pezsp_runtime::TypeId for RewardsAccountParams<LaneId> {
|
||||
const TYPE_ID: [u8; 4] = *b"brap";
|
||||
}
|
||||
|
||||
@@ -84,12 +84,12 @@ pub mod v0 {
|
||||
}
|
||||
|
||||
pub(crate) type RelayerRewardsKeyProviderOf<T, I, LaneId> = RelayerRewardsKeyProvider<
|
||||
<T as frame_system::Config>::AccountId,
|
||||
<T as pezframe_system::Config>::AccountId,
|
||||
<T as Config<I>>::RewardBalance,
|
||||
LaneId,
|
||||
>;
|
||||
|
||||
#[frame_support::storage_alias]
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(crate) type RelayerRewards<T: Config<I>, I: 'static, LaneId> = StorageDoubleMap<
|
||||
Pallet<T, I>,
|
||||
<RelayerRewardsKeyProviderOf<T, I, LaneId> as StorageDoubleMapKeyProvider>::Hasher1,
|
||||
@@ -125,10 +125,10 @@ pub mod v1 {
|
||||
use bp_runtime::StorageDoubleMapKeyProvider;
|
||||
use codec::{Codec, EncodeLike};
|
||||
use core::marker::PhantomData;
|
||||
use frame_support::{
|
||||
pallet_prelude::OptionQuery, traits::UncheckedOnRuntimeUpgrade, Blake2_128Concat, Identity,
|
||||
use pezframe_support::{
|
||||
pezpallet_prelude::OptionQuery, traits::UncheckedOnRuntimeUpgrade, Blake2_128Concat, Identity,
|
||||
};
|
||||
use sp_arithmetic::traits::Zero;
|
||||
use pezsp_arithmetic::traits::Zero;
|
||||
|
||||
pub(crate) struct RelayerRewardsKeyProvider<AccountId, RewardBalance, LaneId>(
|
||||
PhantomData<(AccountId, RewardBalance, LaneId)>,
|
||||
@@ -151,12 +151,12 @@ pub mod v1 {
|
||||
}
|
||||
|
||||
pub(crate) type RelayerRewardsKeyProviderOf<T, I, LaneId> = RelayerRewardsKeyProvider<
|
||||
<T as frame_system::Config>::AccountId,
|
||||
<T as pezframe_system::Config>::AccountId,
|
||||
<T as Config<I>>::RewardBalance,
|
||||
LaneId,
|
||||
>;
|
||||
|
||||
#[frame_support::storage_alias]
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(crate) type RelayerRewards<T: Config<I>, I: 'static, LaneId> = StorageDoubleMap<
|
||||
Pallet<T, I>,
|
||||
<RelayerRewardsKeyProviderOf<T, I, LaneId> as StorageDoubleMapKeyProvider>::Hasher1,
|
||||
@@ -177,7 +177,7 @@ pub mod v1 {
|
||||
relayer: &T::AccountId,
|
||||
reward_balance: T::RewardBalance,
|
||||
) {
|
||||
use sp_runtime::Saturating;
|
||||
use pezsp_runtime::Saturating;
|
||||
|
||||
if reward_balance.is_zero() {
|
||||
return;
|
||||
@@ -240,10 +240,10 @@ pub mod v1 {
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn pre_upgrade() -> Result<Vec<u8>, sp_runtime::DispatchError> {
|
||||
fn pre_upgrade() -> Result<Vec<u8>, pezsp_runtime::DispatchError> {
|
||||
use codec::Encode;
|
||||
use frame_support::BoundedBTreeMap;
|
||||
use sp_runtime::traits::ConstU32;
|
||||
use pezframe_support::BoundedBTreeMap;
|
||||
use pezsp_runtime::traits::ConstU32;
|
||||
|
||||
// collect actual rewards
|
||||
let mut rewards: BoundedBTreeMap<
|
||||
@@ -268,10 +268,10 @@ pub mod v1 {
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn post_upgrade(state: Vec<u8>) -> Result<(), sp_runtime::DispatchError> {
|
||||
fn post_upgrade(state: Vec<u8>) -> Result<(), pezsp_runtime::DispatchError> {
|
||||
use codec::Decode;
|
||||
use frame_support::BoundedBTreeMap;
|
||||
use sp_runtime::traits::ConstU32;
|
||||
use pezframe_support::BoundedBTreeMap;
|
||||
use pezsp_runtime::traits::ConstU32;
|
||||
|
||||
let rewards_before: BoundedBTreeMap<
|
||||
(T::AccountId, LaneId),
|
||||
@@ -298,7 +298,7 @@ pub mod v1 {
|
||||
}
|
||||
tracing::info!(target: LOG_TARGET, ?rewards_after, "Found total migrated rewards");
|
||||
|
||||
frame_support::ensure!(
|
||||
pezframe_support::ensure!(
|
||||
rewards_before == rewards_after,
|
||||
"The rewards were not migrated correctly!."
|
||||
);
|
||||
@@ -309,14 +309,14 @@ pub mod v1 {
|
||||
}
|
||||
|
||||
/// [`UncheckedMigrationV0ToV1`] wrapped in a
|
||||
/// [`VersionedMigration`](frame_support::migrations::VersionedMigration), ensuring the
|
||||
/// [`VersionedMigration`](pezframe_support::migrations::VersionedMigration), ensuring the
|
||||
/// migration is only performed when on-chain version is 0.
|
||||
pub type MigrationToV1<T, I, LaneId> = frame_support::migrations::VersionedMigration<
|
||||
pub type MigrationToV1<T, I, LaneId> = pezframe_support::migrations::VersionedMigration<
|
||||
0,
|
||||
1,
|
||||
UncheckedMigrationV0ToV1<T, I, LaneId>,
|
||||
Pallet<T, I>,
|
||||
<T as frame_system::Config>::DbWeight,
|
||||
<T as pezframe_system::Config>::DbWeight,
|
||||
>;
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ pub mod v2 {
|
||||
use bp_messages::LaneIdType;
|
||||
use bp_relayers::RewardsAccountParams;
|
||||
use core::marker::PhantomData;
|
||||
use frame_support::traits::UncheckedOnRuntimeUpgrade;
|
||||
use pezframe_support::traits::UncheckedOnRuntimeUpgrade;
|
||||
|
||||
/// Migrates the pallet storage to v2.
|
||||
pub struct UncheckedMigrationV1ToV2<T, I, LaneId>(PhantomData<(T, I, LaneId)>);
|
||||
@@ -369,10 +369,10 @@ pub mod v2 {
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn pre_upgrade() -> Result<Vec<u8>, sp_runtime::DispatchError> {
|
||||
fn pre_upgrade() -> Result<Vec<u8>, pezsp_runtime::DispatchError> {
|
||||
use codec::Encode;
|
||||
use frame_support::BoundedBTreeMap;
|
||||
use sp_runtime::traits::ConstU32;
|
||||
use pezframe_support::BoundedBTreeMap;
|
||||
use pezsp_runtime::traits::ConstU32;
|
||||
|
||||
// collect actual rewards
|
||||
let mut rewards: BoundedBTreeMap<
|
||||
@@ -398,10 +398,10 @@ pub mod v2 {
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn post_upgrade(state: Vec<u8>) -> Result<(), sp_runtime::DispatchError> {
|
||||
fn post_upgrade(state: Vec<u8>) -> Result<(), pezsp_runtime::DispatchError> {
|
||||
use codec::{Decode, Encode};
|
||||
use frame_support::BoundedBTreeMap;
|
||||
use sp_runtime::traits::ConstU32;
|
||||
use pezframe_support::BoundedBTreeMap;
|
||||
use pezsp_runtime::traits::ConstU32;
|
||||
|
||||
let rewards_before: BoundedBTreeMap<
|
||||
(T::AccountId, Vec<u8>),
|
||||
@@ -428,7 +428,7 @@ pub mod v2 {
|
||||
}
|
||||
tracing::info!(target: LOG_TARGET, ?rewards_after, "Found total migrated rewards");
|
||||
|
||||
frame_support::ensure!(
|
||||
pezframe_support::ensure!(
|
||||
rewards_before == rewards_after,
|
||||
"The rewards were not migrated correctly!."
|
||||
);
|
||||
@@ -439,13 +439,13 @@ pub mod v2 {
|
||||
}
|
||||
|
||||
/// [`UncheckedMigrationV1ToV2`] wrapped in a
|
||||
/// [`VersionedMigration`](frame_support::migrations::VersionedMigration), ensuring the
|
||||
/// [`VersionedMigration`](pezframe_support::migrations::VersionedMigration), ensuring the
|
||||
/// migration is only performed when on-chain version is 1.
|
||||
pub type MigrationToV2<T, I, LaneId> = frame_support::migrations::VersionedMigration<
|
||||
pub type MigrationToV2<T, I, LaneId> = pezframe_support::migrations::VersionedMigration<
|
||||
1,
|
||||
2,
|
||||
UncheckedMigrationV1ToV2<T, I, LaneId>,
|
||||
Pallet<T, I>,
|
||||
<T as frame_system::Config>::DbWeight,
|
||||
<T as pezframe_system::Config>::DbWeight,
|
||||
>;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#![cfg(test)]
|
||||
|
||||
use crate as pallet_bridge_relayers;
|
||||
use crate as pezpallet_bridge_relayers;
|
||||
|
||||
use bp_header_chain::ChainWithGrandpa;
|
||||
use bp_messages::{
|
||||
@@ -29,14 +29,14 @@ use bp_relayers::{
|
||||
use bp_runtime::{messages::MessageDispatchResult, Chain, ChainId, Teyrchain};
|
||||
use bp_teyrchains::SingleParaStoredHeaderDataBuilder;
|
||||
use codec::Encode;
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
derive_impl, parameter_types,
|
||||
traits::fungible::Mutate,
|
||||
weights::{ConstantMultiplier, IdentityFee, RuntimeDbWeight, Weight},
|
||||
};
|
||||
use pallet_transaction_payment::Multiplier;
|
||||
use sp_core::H256;
|
||||
use sp_runtime::{
|
||||
use pezpallet_transaction_payment::Multiplier;
|
||||
use pezsp_core::H256;
|
||||
use pezsp_runtime::{
|
||||
traits::{BlakeTwo256, ConstU32, ConstU64, ConstU8},
|
||||
BuildStorage, FixedPointNumber, Perquintill, StateVersion,
|
||||
};
|
||||
@@ -52,9 +52,9 @@ pub type ThisChainHash = H256;
|
||||
/// Hasher at `ThisChain`.
|
||||
pub type ThisChainHasher = BlakeTwo256;
|
||||
/// Header of `ThisChain`.
|
||||
pub type ThisChainHeader = sp_runtime::generic::Header<ThisChainBlockNumber, ThisChainHasher>;
|
||||
pub type ThisChainHeader = pezsp_runtime::generic::Header<ThisChainBlockNumber, ThisChainHasher>;
|
||||
/// Block of `ThisChain`.
|
||||
pub type ThisChainBlock = frame_system::mocking::MockBlockU32<TestRuntime>;
|
||||
pub type ThisChainBlock = pezframe_system::mocking::MockBlockU32<TestRuntime>;
|
||||
|
||||
/// Account identifier at the `BridgedChain`.
|
||||
pub type BridgedChainAccountId = u128;
|
||||
@@ -68,7 +68,7 @@ pub type BridgedChainHash = H256;
|
||||
pub type BridgedChainHasher = BlakeTwo256;
|
||||
/// Header of the `BridgedChain`.
|
||||
pub type BridgedChainHeader =
|
||||
sp_runtime::generic::Header<BridgedChainBlockNumber, BridgedChainHasher>;
|
||||
pezsp_runtime::generic::Header<BridgedChainBlockNumber, BridgedChainHasher>;
|
||||
|
||||
/// Bridged chain id used in tests.
|
||||
pub const TEST_BRIDGED_CHAIN_ID: ChainId = *b"brdg";
|
||||
@@ -97,7 +97,7 @@ impl Chain for ThisUnderlyingChain {
|
||||
type AccountId = ThisChainAccountId;
|
||||
type Balance = ThisChainBalance;
|
||||
type Nonce = u32;
|
||||
type Signature = sp_runtime::MultiSignature;
|
||||
type Signature = pezsp_runtime::MultiSignature;
|
||||
|
||||
const STATE_VERSION: StateVersion = StateVersion::V1;
|
||||
|
||||
@@ -130,7 +130,7 @@ impl Chain for BridgedUnderlyingTeyrchain {
|
||||
type AccountId = BridgedChainAccountId;
|
||||
type Balance = BridgedChainBalance;
|
||||
type Nonce = u32;
|
||||
type Signature = sp_runtime::MultiSignature;
|
||||
type Signature = pezsp_runtime::MultiSignature;
|
||||
|
||||
const STATE_VERSION: StateVersion = StateVersion::V1;
|
||||
|
||||
@@ -161,7 +161,7 @@ impl Teyrchain for BridgedUnderlyingTeyrchain {
|
||||
const MAX_HEADER_SIZE: u32 = 1_024;
|
||||
}
|
||||
|
||||
pub type TestStakeAndSlash = pallet_bridge_relayers::StakeAndSlashNamed<
|
||||
pub type TestStakeAndSlash = pezpallet_bridge_relayers::StakeAndSlashNamed<
|
||||
ThisChainAccountId,
|
||||
ThisChainBlockNumber,
|
||||
Balances,
|
||||
@@ -170,17 +170,17 @@ pub type TestStakeAndSlash = pallet_bridge_relayers::StakeAndSlashNamed<
|
||||
Lease,
|
||||
>;
|
||||
|
||||
frame_support::construct_runtime! {
|
||||
pezframe_support::construct_runtime! {
|
||||
pub enum TestRuntime
|
||||
{
|
||||
System: frame_system,
|
||||
Utility: pallet_utility,
|
||||
Balances: pallet_balances,
|
||||
TransactionPayment: pallet_transaction_payment,
|
||||
BridgeRelayers: pallet_bridge_relayers,
|
||||
BridgeGrandpa: pallet_bridge_grandpa,
|
||||
BridgeTeyrchains: pallet_bridge_teyrchains,
|
||||
BridgeMessages: pallet_bridge_messages,
|
||||
System: pezframe_system,
|
||||
Utility: pezpallet_utility,
|
||||
Balances: pezpallet_balances,
|
||||
TransactionPayment: pezpallet_transaction_payment,
|
||||
BridgeRelayers: pezpallet_bridge_relayers,
|
||||
BridgeGrandpa: pezpallet_bridge_grandpa,
|
||||
BridgeTeyrchains: pezpallet_bridge_teyrchains,
|
||||
BridgeMessages: pezpallet_bridge_messages,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,38 +196,38 @@ parameter_types! {
|
||||
pub const TransactionByteFee: ThisChainBalance = 1;
|
||||
pub AdjustmentVariable: Multiplier = Multiplier::saturating_from_rational(3, 100_000);
|
||||
pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000u128);
|
||||
pub MaximumMultiplier: Multiplier = sp_runtime::traits::Bounded::max_value();
|
||||
pub MaximumMultiplier: Multiplier = pezsp_runtime::traits::Bounded::max_value();
|
||||
}
|
||||
|
||||
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
|
||||
impl frame_system::Config for TestRuntime {
|
||||
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
|
||||
impl pezframe_system::Config for TestRuntime {
|
||||
type Block = ThisChainBlock;
|
||||
// TODO: remove when https://github.com/paritytech/polkadot-sdk/pull/4543 merged
|
||||
// TODO: remove when https://github.com/pezkuwichain/kurdistan-sdk/issues/120 merged
|
||||
type BlockHashCount = ConstU32<10>;
|
||||
type AccountData = pallet_balances::AccountData<ThisChainBalance>;
|
||||
type AccountData = pezpallet_balances::AccountData<ThisChainBalance>;
|
||||
type DbWeight = DbWeight;
|
||||
}
|
||||
|
||||
#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)]
|
||||
impl pallet_balances::Config for TestRuntime {
|
||||
#[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)]
|
||||
impl pezpallet_balances::Config for TestRuntime {
|
||||
type ReserveIdentifier = [u8; 8];
|
||||
type AccountStore = System;
|
||||
}
|
||||
|
||||
impl pallet_utility::Config for TestRuntime {
|
||||
impl pezpallet_utility::Config for TestRuntime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type PalletsOrigin = OriginCaller;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
#[derive_impl(pallet_transaction_payment::config_preludes::TestDefaultConfig)]
|
||||
impl pallet_transaction_payment::Config for TestRuntime {
|
||||
type OnChargeTransaction = pallet_transaction_payment::FungibleAdapter<Balances, ()>;
|
||||
#[derive_impl(pezpallet_transaction_payment::config_preludes::TestDefaultConfig)]
|
||||
impl pezpallet_transaction_payment::Config for TestRuntime {
|
||||
type OnChargeTransaction = pezpallet_transaction_payment::FungibleAdapter<Balances, ()>;
|
||||
type OperationalFeeMultiplier = ConstU8<5>;
|
||||
type WeightToFee = IdentityFee<ThisChainBalance>;
|
||||
type LengthToFee = ConstantMultiplier<ThisChainBalance, TransactionByteFee>;
|
||||
type FeeMultiplierUpdate = pallet_transaction_payment::TargetedFeeAdjustment<
|
||||
type FeeMultiplierUpdate = pezpallet_transaction_payment::TargetedFeeAdjustment<
|
||||
TestRuntime,
|
||||
TargetBlockFullness,
|
||||
AdjustmentVariable,
|
||||
@@ -237,16 +237,16 @@ impl pallet_transaction_payment::Config for TestRuntime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
}
|
||||
|
||||
impl pallet_bridge_grandpa::Config for TestRuntime {
|
||||
impl pezpallet_bridge_grandpa::Config for TestRuntime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type BridgedChain = BridgedUnderlyingTeyrchain;
|
||||
type MaxFreeHeadersPerBlock = ConstU32<4>;
|
||||
type FreeHeadersInterval = ConstU32<1_024>;
|
||||
type HeadersToKeep = ConstU32<8>;
|
||||
type WeightInfo = pallet_bridge_grandpa::weights::BridgeWeight<TestRuntime>;
|
||||
type WeightInfo = pezpallet_bridge_grandpa::weights::BridgeWeight<TestRuntime>;
|
||||
}
|
||||
|
||||
impl pallet_bridge_teyrchains::Config for TestRuntime {
|
||||
impl pezpallet_bridge_teyrchains::Config for TestRuntime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type BridgesGrandpaPalletInstance = ();
|
||||
type ParasPalletName = BridgedParasPalletName;
|
||||
@@ -254,20 +254,20 @@ impl pallet_bridge_teyrchains::Config for TestRuntime {
|
||||
SingleParaStoredHeaderDataBuilder<BridgedUnderlyingTeyrchain>;
|
||||
type HeadsToKeep = ConstU32<8>;
|
||||
type MaxParaHeadDataSize = ConstU32<1024>;
|
||||
type WeightInfo = pallet_bridge_teyrchains::weights::BridgeWeight<TestRuntime>;
|
||||
type WeightInfo = pezpallet_bridge_teyrchains::weights::BridgeWeight<TestRuntime>;
|
||||
type OnNewHead = ();
|
||||
}
|
||||
|
||||
impl pallet_bridge_messages::Config for TestRuntime {
|
||||
impl pezpallet_bridge_messages::Config for TestRuntime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type WeightInfo = pallet_bridge_messages::weights::BridgeWeight<TestRuntime>;
|
||||
type WeightInfo = pezpallet_bridge_messages::weights::BridgeWeight<TestRuntime>;
|
||||
|
||||
type OutboundPayload = Vec<u8>;
|
||||
type InboundPayload = Vec<u8>;
|
||||
type LaneId = TestLaneIdType;
|
||||
|
||||
type DeliveryPayments = ();
|
||||
type DeliveryConfirmationPayments = pallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter<
|
||||
type DeliveryConfirmationPayments = pezpallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter<
|
||||
TestRuntime,
|
||||
(),
|
||||
(),
|
||||
@@ -281,10 +281,10 @@ impl pallet_bridge_messages::Config for TestRuntime {
|
||||
type BridgedHeaderChain = BridgeGrandpa;
|
||||
}
|
||||
|
||||
impl pallet_bridge_relayers::Config for TestRuntime {
|
||||
impl pezpallet_bridge_relayers::Config for TestRuntime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type RewardBalance = RewardBalance;
|
||||
type Reward = RewardsAccountParams<pallet_bridge_messages::LaneIdOf<TestRuntime, ()>>;
|
||||
type Reward = RewardsAccountParams<pezpallet_bridge_messages::LaneIdOf<TestRuntime, ()>>;
|
||||
type PaymentProcedure = TestPaymentProcedure;
|
||||
type StakeAndSlash = TestStakeAndSlash;
|
||||
type Balance = ThisChainBalance;
|
||||
@@ -292,7 +292,7 @@ impl pallet_bridge_relayers::Config for TestRuntime {
|
||||
}
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
impl pallet_bridge_relayers::benchmarking::Config for TestRuntime {
|
||||
impl pezpallet_bridge_relayers::benchmarking::Config for TestRuntime {
|
||||
fn bench_reward() -> Self::Reward {
|
||||
RewardsAccountParams::new(
|
||||
TestLaneIdType::default(),
|
||||
@@ -317,7 +317,7 @@ impl pallet_bridge_relayers::benchmarking::Config for TestRuntime {
|
||||
}
|
||||
|
||||
fn deposit_account(account: Self::AccountId, balance: Self::Balance) {
|
||||
frame_support::assert_ok!(Balances::mint_into(
|
||||
pezframe_support::assert_ok!(Balances::mint_into(
|
||||
&account,
|
||||
balance.saturating_add(ExistentialDeposit::get())
|
||||
));
|
||||
@@ -370,7 +370,7 @@ pub struct DummyMessageDispatch;
|
||||
|
||||
impl DummyMessageDispatch {
|
||||
pub fn deactivate(lane: TestLaneIdType) {
|
||||
frame_support::storage::unhashed::put(&(b"inactive", lane).encode()[..], &false);
|
||||
pezframe_support::storage::unhashed::put(&(b"inactive", lane).encode()[..], &false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,7 +380,7 @@ impl MessageDispatch for DummyMessageDispatch {
|
||||
type LaneId = TestLaneIdType;
|
||||
|
||||
fn is_active(lane: Self::LaneId) -> bool {
|
||||
frame_support::storage::unhashed::take::<bool>(&(b"inactive", lane).encode()[..]) !=
|
||||
pezframe_support::storage::unhashed::take::<bool>(&(b"inactive", lane).encode()[..]) !=
|
||||
Some(false)
|
||||
}
|
||||
|
||||
@@ -407,9 +407,9 @@ pub fn test_reward_account_param() -> RewardsAccountParams<TestLaneIdType> {
|
||||
}
|
||||
|
||||
/// Return test externalities to use in tests.
|
||||
pub fn new_test_ext() -> sp_io::TestExternalities {
|
||||
let t = frame_system::GenesisConfig::<TestRuntime>::default().build_storage().unwrap();
|
||||
sp_io::TestExternalities::new(t)
|
||||
pub fn new_test_ext() -> pezsp_io::TestExternalities {
|
||||
let t = pezframe_system::GenesisConfig::<TestRuntime>::default().build_storage().unwrap();
|
||||
pezsp_io::TestExternalities::new(t)
|
||||
}
|
||||
|
||||
/// Run pallet test.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Code that allows relayers pallet to be used as a payment mechanism for
|
||||
//! the `pallet-bridge-messages` pallet using `RewardsAccountParams`.
|
||||
//! the `pezpallet-bridge-messages` pallet using `RewardsAccountParams`.
|
||||
|
||||
use crate::{Config, Pallet};
|
||||
|
||||
@@ -28,12 +28,12 @@ pub use bp_relayers::PayRewardFromAccount;
|
||||
use bp_relayers::{RewardsAccountOwner, RewardsAccountParams};
|
||||
use bp_runtime::Chain;
|
||||
use core::{marker::PhantomData, ops::RangeInclusive};
|
||||
use frame_support::{sp_runtime::SaturatedConversion, traits::Get};
|
||||
use pallet_bridge_messages::LaneIdOf;
|
||||
use sp_arithmetic::traits::{Saturating, Zero};
|
||||
use pezframe_support::{pezsp_runtime::SaturatedConversion, traits::Get};
|
||||
use pezpallet_bridge_messages::LaneIdOf;
|
||||
use pezsp_arithmetic::traits::{Saturating, Zero};
|
||||
|
||||
/// Adapter that allows relayers pallet to be used as a delivery+dispatch payment mechanism
|
||||
/// for the `pallet-bridge-messages` pallet and using `RewardsAccountParams`.
|
||||
/// for the `pezpallet-bridge-messages` pallet and using `RewardsAccountParams`.
|
||||
pub struct DeliveryConfirmationPaymentsAdapter<T, MI, RI, DeliveryReward>(
|
||||
PhantomData<(T, MI, RI, DeliveryReward)>,
|
||||
);
|
||||
@@ -41,7 +41,7 @@ pub struct DeliveryConfirmationPaymentsAdapter<T, MI, RI, DeliveryReward>(
|
||||
impl<T, MI, RI, DeliveryReward> DeliveryConfirmationPayments<T::AccountId, LaneIdOf<T, MI>>
|
||||
for DeliveryConfirmationPaymentsAdapter<T, MI, RI, DeliveryReward>
|
||||
where
|
||||
T: Config<RI> + pallet_bridge_messages::Config<MI>,
|
||||
T: Config<RI> + pezpallet_bridge_messages::Config<MI>,
|
||||
MI: 'static,
|
||||
RI: 'static,
|
||||
DeliveryReward: Get<T::RewardBalance>,
|
||||
@@ -76,7 +76,7 @@ where
|
||||
|
||||
// Update rewards to given relayers, optionally rewarding confirmation relayer.
|
||||
fn register_relayers_rewards<
|
||||
T: Config<RI> + pallet_bridge_messages::Config<MI>,
|
||||
T: Config<RI> + pezpallet_bridge_messages::Config<MI>,
|
||||
RI: 'static,
|
||||
MI: 'static,
|
||||
>(
|
||||
@@ -117,7 +117,7 @@ mod tests {
|
||||
use crate::{mock::*, RelayerRewards};
|
||||
use bp_messages::LaneIdType;
|
||||
use bp_relayers::PaymentProcedure;
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
assert_ok,
|
||||
traits::fungible::{Inspect, Mutate},
|
||||
};
|
||||
@@ -178,7 +178,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn pay_reward_from_account_actually_pays_reward() {
|
||||
type Balances = pallet_balances::Pallet<TestRuntime>;
|
||||
type Balances = pezpallet_balances::Pallet<TestRuntime>;
|
||||
type PayLaneRewardFromAccount =
|
||||
PayRewardFromAccount<Balances, ThisChainAccountId, TestLaneIdType, RewardBalance>;
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
use bp_relayers::StakeAndSlash;
|
||||
use codec::Codec;
|
||||
use core::{fmt::Debug, marker::PhantomData};
|
||||
use frame_support::traits::{tokens::BalanceStatus, NamedReservableCurrency};
|
||||
use sp_runtime::{traits::Get, DispatchError, DispatchResult};
|
||||
use pezframe_support::traits::{tokens::BalanceStatus, NamedReservableCurrency};
|
||||
use pezsp_runtime::{traits::Get, DispatchError, DispatchResult};
|
||||
|
||||
/// `StakeAndSlash` that works with `NamedReservableCurrency` and uses named
|
||||
/// reservations.
|
||||
@@ -74,8 +74,8 @@ mod tests {
|
||||
use crate::mock::*;
|
||||
use bp_relayers::ExplicitOrAccountParams;
|
||||
|
||||
use frame_support::traits::fungible::Mutate;
|
||||
use sp_runtime::traits::IdentifyAccount;
|
||||
use pezframe_support::traits::fungible::Mutate;
|
||||
use pezsp_runtime::traits::IdentifyAccount;
|
||||
|
||||
fn test_stake() -> ThisChainBalance {
|
||||
Stake::get()
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Autogenerated weights for pallet_bridge_relayers
|
||||
//! Autogenerated weights for pezpallet_bridge_relayers
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE BIZINIKIWI BENCHMARK CLI VERSION 4.0.0-dev
|
||||
//! DATE: 2023-04-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! WORST CASE MAP SIZE: `1000000`
|
||||
//! HOSTNAME: `covid`, CPU: `11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz`
|
||||
@@ -29,7 +29,7 @@
|
||||
// --chain=dev
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --pallet=pallet_bridge_relayers
|
||||
// --pallet=pezpallet_bridge_relayers
|
||||
// --extrinsic=*
|
||||
// --execution=wasm
|
||||
// --wasm-execution=Compiled
|
||||
@@ -43,12 +43,12 @@
|
||||
#![allow(missing_docs)]
|
||||
|
||||
use core::marker::PhantomData;
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
traits::Get,
|
||||
weights::{constants::RocksDbWeight, Weight},
|
||||
};
|
||||
|
||||
/// Weight functions needed for pallet_bridge_relayers.
|
||||
/// Weight functions needed for pezpallet_bridge_relayers.
|
||||
pub trait WeightInfo {
|
||||
fn claim_rewards() -> Weight;
|
||||
fn claim_rewards_to() -> Weight;
|
||||
@@ -58,11 +58,11 @@ pub trait WeightInfo {
|
||||
fn register_relayer_reward() -> Weight;
|
||||
}
|
||||
|
||||
/// Weights for `pallet_bridge_relayers` that are generated using one of the Bridge testnets.
|
||||
/// Weights for `pezpallet_bridge_relayers` that are generated using one of the Bridge testnets.
|
||||
///
|
||||
/// Those weights are test only and must never be used in production.
|
||||
pub struct BridgeWeight<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
impl<T: pezframe_system::Config> WeightInfo for BridgeWeight<T> {
|
||||
/// Storage: BridgeRelayers RelayerRewards (r:1 w:1)
|
||||
///
|
||||
/// Proof: BridgeRelayers RelayerRewards (max_values: None, max_size: Some(65), added: 2540,
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
use crate::weights::WeightInfo;
|
||||
|
||||
use frame_support::pallet_prelude::Weight;
|
||||
use pezframe_support::pezpallet_prelude::Weight;
|
||||
|
||||
/// Extended weight info.
|
||||
pub trait WeightInfoExt: WeightInfo {
|
||||
|
||||
Reference in New Issue
Block a user