Refactoring Checkpoint: (WIP)
This commit is contained in:
@@ -21,7 +21,7 @@ tracing = { workspace = true }
|
||||
|
||||
# Bridge Dependencies
|
||||
bp-beefy = { workspace = true }
|
||||
bp-runtime = { workspace = true }
|
||||
pezbp-runtime = { workspace = true }
|
||||
|
||||
# Bizinikiwi Dependencies
|
||||
pezframe-support = { workspace = true }
|
||||
@@ -43,7 +43,7 @@ pezsp-io = { workspace = true, default-features = true }
|
||||
default = ["std"]
|
||||
std = [
|
||||
"bp-beefy/std",
|
||||
"bp-runtime/std",
|
||||
"pezbp-runtime/std",
|
||||
"codec/std",
|
||||
"pezframe-support/std",
|
||||
"pezframe-system/std",
|
||||
@@ -63,7 +63,7 @@ try-runtime = [
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"bp-beefy/runtime-benchmarks",
|
||||
"bp-runtime/runtime-benchmarks",
|
||||
"pezbp-runtime/runtime-benchmarks",
|
||||
"bp-test-utils/runtime-benchmarks",
|
||||
"pezframe-support/runtime-benchmarks",
|
||||
"pezframe-system/runtime-benchmarks",
|
||||
|
||||
@@ -51,9 +51,9 @@ pub const LOG_TARGET: &str = "runtime::bridge-beefy";
|
||||
/// Configured bridged chain.
|
||||
pub type BridgedChain<T, I> = <T as Config<I>>::BridgedChain;
|
||||
/// Block number, used by configured bridged chain.
|
||||
pub type BridgedBlockNumber<T, I> = bp_runtime::BlockNumberOf<BridgedChain<T, I>>;
|
||||
pub type BridgedBlockNumber<T, I> = pezbp_runtime::BlockNumberOf<BridgedChain<T, I>>;
|
||||
/// Block hash, used by configured bridged chain.
|
||||
pub type BridgedBlockHash<T, I> = bp_runtime::HashOf<BridgedChain<T, I>>;
|
||||
pub type BridgedBlockHash<T, I> = pezbp_runtime::HashOf<BridgedChain<T, I>>;
|
||||
|
||||
/// Pallet initialization data.
|
||||
pub type InitializationDataOf<T, I> =
|
||||
@@ -98,7 +98,7 @@ pub struct ImportedCommitmentsInfoData<BlockNumber> {
|
||||
#[pezframe_support::pallet(dev_mode)]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
use bp_runtime::{BasicOperatingMode, OwnedBridgeModule};
|
||||
use pezbp_runtime::{BasicOperatingMode, OwnedBridgeModule};
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
@@ -383,7 +383,7 @@ pub mod pallet {
|
||||
/// The validators are not matching the merkle tree root of the authority set.
|
||||
InvalidValidatorSetRoot,
|
||||
/// Error generated by the `OwnedBridgeModule` trait.
|
||||
BridgeModule(bp_runtime::OwnedBridgeModuleError),
|
||||
BridgeModule(pezbp_runtime::OwnedBridgeModuleError),
|
||||
}
|
||||
|
||||
/// Initialize pallet with given parameters.
|
||||
@@ -415,7 +415,7 @@ pub mod pallet {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use bp_runtime::{BasicOperatingMode, OwnedBridgeModuleError};
|
||||
use pezbp_runtime::{BasicOperatingMode, OwnedBridgeModuleError};
|
||||
use bp_test_utils::generate_owned_bridge_module_tests;
|
||||
use pezframe_support::{assert_noop, assert_ok, traits::Get};
|
||||
use mock::*;
|
||||
|
||||
@@ -22,7 +22,7 @@ use crate::{
|
||||
};
|
||||
|
||||
use bp_beefy::{BeefyValidatorSignatureOf, ChainWithBeefy, Commitment, MmrDataOrHash};
|
||||
use bp_runtime::{BasicOperatingMode, Chain, ChainId};
|
||||
use pezbp_runtime::{BasicOperatingMode, Chain, ChainId};
|
||||
use codec::Encode;
|
||||
use pezframe_support::{construct_runtime, derive_impl, weights::Weight};
|
||||
use pezsp_core::{sr25519::Signature, Pair};
|
||||
|
||||
@@ -20,8 +20,8 @@ scale-info = { features = ["derive"], workspace = true }
|
||||
tracing = { workspace = true }
|
||||
|
||||
# Bridge Dependencies
|
||||
bp-header-chain = { workspace = true }
|
||||
bp-runtime = { workspace = true }
|
||||
bp-header-pez-chain = { workspace = true }
|
||||
pezbp-runtime = { workspace = true }
|
||||
|
||||
# Bizinikiwi Dependencies
|
||||
pezframe-support = { workspace = true }
|
||||
@@ -35,15 +35,15 @@ bp-test-utils = { optional = true, workspace = true }
|
||||
pezframe-benchmarking = { optional = true, workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
bp-runtime = { features = ["test-helpers"], workspace = true }
|
||||
pezbp-runtime = { features = ["test-helpers"], workspace = true }
|
||||
pezsp-core = { workspace = true, default-features = true }
|
||||
pezsp-io = { workspace = true, default-features = true }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"bp-header-chain/std",
|
||||
"bp-runtime/std",
|
||||
"bp-header-pez-chain/std",
|
||||
"pezbp-runtime/std",
|
||||
"bp-test-utils/std",
|
||||
"codec/std",
|
||||
"pezframe-benchmarking/std",
|
||||
@@ -56,8 +56,8 @@ std = [
|
||||
"tracing/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"bp-header-chain/runtime-benchmarks",
|
||||
"bp-runtime/runtime-benchmarks",
|
||||
"bp-header-pez-chain/runtime-benchmarks",
|
||||
"pezbp-runtime/runtime-benchmarks",
|
||||
"bp-test-utils",
|
||||
"bp-test-utils?/runtime-benchmarks",
|
||||
"pezframe-benchmarking/runtime-benchmarks",
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
|
||||
use crate::*;
|
||||
|
||||
use bp_header_chain::justification::required_justification_precommits;
|
||||
use bp_runtime::BasicOperatingMode;
|
||||
use bp_header_pez_chain::justification::required_justification_precommits;
|
||||
use pezbp_runtime::BasicOperatingMode;
|
||||
use bp_test_utils::{
|
||||
accounts, make_justification_for_header, JustificationGeneratorParams, TEST_GRANDPA_ROUND,
|
||||
TEST_GRANDPA_SET_ID,
|
||||
|
||||
@@ -18,11 +18,11 @@ use crate::{
|
||||
weights::WeightInfo, BestFinalized, BridgedBlockNumber, BridgedHeader, Config,
|
||||
CurrentAuthoritySet, Error, FreeHeadersRemaining, Pallet,
|
||||
};
|
||||
use bp_header_chain::{
|
||||
use bp_header_pez_chain::{
|
||||
justification::GrandpaJustification, submit_finality_proof_limits_extras,
|
||||
SubmitFinalityProofInfo,
|
||||
};
|
||||
use bp_runtime::{BlockNumberOf, Chain, OwnedBridgeModule};
|
||||
use pezbp_runtime::{BlockNumberOf, Chain, OwnedBridgeModule};
|
||||
use pezframe_support::{
|
||||
dispatch::CallableCallFor,
|
||||
traits::{Get, IsSubType},
|
||||
@@ -307,8 +307,8 @@ mod tests {
|
||||
BestFinalized, Config, CurrentAuthoritySet, FreeHeadersRemaining, PalletOperatingMode,
|
||||
StoredAuthoritySet, WeightInfo,
|
||||
};
|
||||
use bp_header_chain::{ChainWithGrandpa, SubmitFinalityProofInfo};
|
||||
use bp_runtime::{BasicOperatingMode, HeaderId};
|
||||
use bp_header_pez_chain::{ChainWithGrandpa, SubmitFinalityProofInfo};
|
||||
use pezbp_runtime::{BasicOperatingMode, HeaderId};
|
||||
use bp_test_utils::{
|
||||
make_default_justification, make_justification_for_header, JustificationGeneratorParams,
|
||||
TEST_GRANDPA_SET_ID,
|
||||
|
||||
@@ -37,12 +37,12 @@
|
||||
|
||||
pub use storage_types::StoredAuthoritySet;
|
||||
|
||||
use bp_header_chain::{
|
||||
use bp_header_pez_chain::{
|
||||
justification::GrandpaJustification, AuthoritySet, ChainWithGrandpa, GrandpaConsensusLogReader,
|
||||
HeaderChain, InitializationData, StoredHeaderData, StoredHeaderDataBuilder,
|
||||
StoredHeaderGrandpaInfo,
|
||||
};
|
||||
use bp_runtime::{BlockNumberOf, HashOf, HasherOf, HeaderId, HeaderOf, OwnedBridgeModule};
|
||||
use pezbp_runtime::{BlockNumberOf, HashOf, HasherOf, HeaderId, HeaderOf, OwnedBridgeModule};
|
||||
use pezframe_support::{dispatch::PostDispatchInfo, ensure, DefaultNoBound};
|
||||
use pezsp_consensus_grandpa::{AuthorityList, SetId};
|
||||
use pezsp_runtime::{
|
||||
@@ -91,7 +91,7 @@ pub type BridgedStoredHeaderData<T, I> =
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
use bp_runtime::BasicOperatingMode;
|
||||
use pezbp_runtime::BasicOperatingMode;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
@@ -530,7 +530,7 @@ pub mod pallet {
|
||||
/// Too many authorities in the set.
|
||||
TooManyAuthoritiesInSet,
|
||||
/// Error generated by the `OwnedBridgeModule` trait.
|
||||
BridgeModule(bp_runtime::OwnedBridgeModuleError),
|
||||
BridgeModule(pezbp_runtime::OwnedBridgeModuleError),
|
||||
/// The `current_set_id` argument of the `submit_finality_proof_ex` doesn't match
|
||||
/// the id of the current set, known to the pallet.
|
||||
InvalidAuthoritySetId,
|
||||
@@ -677,9 +677,9 @@ pub mod pallet {
|
||||
justification: &GrandpaJustification<BridgedHeader<T, I>>,
|
||||
hash: BridgedBlockHash<T, I>,
|
||||
number: BridgedBlockNumber<T, I>,
|
||||
authority_set: bp_header_chain::AuthoritySet,
|
||||
authority_set: bp_header_pez_chain::AuthoritySet,
|
||||
) -> Result<(), pezsp_runtime::DispatchError> {
|
||||
use bp_header_chain::justification::verify_justification;
|
||||
use bp_header_pez_chain::justification::verify_justification;
|
||||
|
||||
Ok(verify_justification::<BridgedHeader<T, I>>(
|
||||
(hash, number),
|
||||
@@ -816,7 +816,7 @@ pub fn initialize_for_benchmarks<T: Config<I>, I: 'static>(header: BridgedHeader
|
||||
authority_list: pezsp_std::vec::Vec::new(), /* we don't verify any proofs in external
|
||||
* benchmarks */
|
||||
set_id: 0,
|
||||
operating_mode: bp_runtime::BasicOperatingMode::Normal,
|
||||
operating_mode: pezbp_runtime::BasicOperatingMode::Normal,
|
||||
})
|
||||
.expect("only used from benchmarks; benchmarks are correct; qed");
|
||||
}
|
||||
@@ -835,8 +835,8 @@ mod tests {
|
||||
run_test, test_header, FreeHeadersInterval, RuntimeEvent as TestEvent, RuntimeOrigin,
|
||||
System, TestBridgedChain, TestHeader, TestNumber, TestRuntime, MAX_BRIDGED_AUTHORITIES,
|
||||
};
|
||||
use bp_header_chain::BridgeGrandpaCall;
|
||||
use bp_runtime::BasicOperatingMode;
|
||||
use bp_header_pez_chain::BridgeGrandpaCall;
|
||||
use pezbp_runtime::BasicOperatingMode;
|
||||
use bp_test_utils::{
|
||||
authority_list, generate_owned_bridge_module_tests, make_default_justification,
|
||||
make_justification_for_header, JustificationGeneratorParams, ALICE, BOB,
|
||||
@@ -1059,7 +1059,7 @@ mod tests {
|
||||
));
|
||||
assert_noop!(
|
||||
submit_finality_proof(1),
|
||||
Error::<TestRuntime>::BridgeModule(bp_runtime::OwnedBridgeModuleError::Halted)
|
||||
Error::<TestRuntime>::BridgeModule(pezbp_runtime::OwnedBridgeModuleError::Halted)
|
||||
);
|
||||
|
||||
assert_ok!(Pallet::<TestRuntime>::set_operating_mode(
|
||||
@@ -1453,7 +1453,7 @@ mod tests {
|
||||
Default::default(),
|
||||
)
|
||||
.map(|_| ()),
|
||||
bp_header_chain::HeaderChainError::UnknownHeader,
|
||||
bp_header_pez_chain::HeaderChainError::UnknownHeader,
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -1461,7 +1461,7 @@ mod tests {
|
||||
#[test]
|
||||
fn parse_finalized_storage_accepts_valid_proof() {
|
||||
run_test(|| {
|
||||
let (state_root, storage_proof) = bp_runtime::craft_valid_storage_proof();
|
||||
let (state_root, storage_proof) = pezbp_runtime::craft_valid_storage_proof();
|
||||
|
||||
let mut header = test_header(2);
|
||||
header.set_state_root(state_root);
|
||||
@@ -1666,17 +1666,17 @@ mod tests {
|
||||
fn storage_keys_computed_properly() {
|
||||
assert_eq!(
|
||||
PalletOperatingMode::<TestRuntime>::storage_value_final_key().to_vec(),
|
||||
bp_header_chain::storage_keys::pezpallet_operating_mode_key("Grandpa").0,
|
||||
bp_header_pez_chain::storage_keys::pezpallet_operating_mode_key("Grandpa").0,
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
CurrentAuthoritySet::<TestRuntime>::storage_value_final_key().to_vec(),
|
||||
bp_header_chain::storage_keys::current_authority_set_key("Grandpa").0,
|
||||
bp_header_pez_chain::storage_keys::current_authority_set_key("Grandpa").0,
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
BestFinalized::<TestRuntime>::storage_value_final_key().to_vec(),
|
||||
bp_header_chain::storage_keys::best_finalized_key("Grandpa").0,
|
||||
bp_header_pez_chain::storage_keys::best_finalized_key("Grandpa").0,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
// From construct_runtime macro
|
||||
#![allow(clippy::from_over_into)]
|
||||
|
||||
use bp_header_chain::ChainWithGrandpa;
|
||||
use bp_runtime::{Chain, ChainId};
|
||||
use bp_header_pez_chain::ChainWithGrandpa;
|
||||
use pezbp_runtime::{Chain, ChainId};
|
||||
use pezframe_support::{
|
||||
construct_runtime, derive_impl, parameter_types, pezsp_runtime::StateVersion, traits::Hooks,
|
||||
weights::Weight,
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
use crate::{Config, Error};
|
||||
|
||||
use bp_header_chain::{AuthoritySet, ChainWithGrandpa};
|
||||
use bp_header_pez_chain::{AuthoritySet, ChainWithGrandpa};
|
||||
use codec::{Decode, Encode, MaxEncodedLen};
|
||||
use pezframe_support::{traits::Get, BoundedVec, CloneNoBound, RuntimeDebugNoBound};
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
@@ -18,9 +18,9 @@ scale-info = { features = ["derive"], workspace = true }
|
||||
tracing = { workspace = true }
|
||||
|
||||
# Bridge dependencies
|
||||
bp-header-chain = { workspace = true }
|
||||
bp-header-pez-chain = { workspace = true }
|
||||
bp-messages = { workspace = true }
|
||||
bp-runtime = { workspace = true }
|
||||
pezbp-runtime = { workspace = true }
|
||||
|
||||
# Bizinikiwi Dependencies
|
||||
pezframe-benchmarking = { optional = true, workspace = true }
|
||||
@@ -31,7 +31,7 @@ pezsp-std = { workspace = true }
|
||||
pezsp-trie = { optional = true, workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
bp-runtime = { features = ["test-helpers"], workspace = true }
|
||||
pezbp-runtime = { features = ["test-helpers"], workspace = true }
|
||||
bp-test-utils = { workspace = true }
|
||||
pezpallet-balances = { workspace = true }
|
||||
pezpallet-bridge-grandpa = { workspace = true }
|
||||
@@ -41,9 +41,9 @@ pezsp-io = { workspace = true }
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"bp-header-chain/std",
|
||||
"bp-header-pez-chain/std",
|
||||
"bp-messages/std",
|
||||
"bp-runtime/std",
|
||||
"pezbp-runtime/std",
|
||||
"bp-test-utils/std",
|
||||
"codec/std",
|
||||
"pezframe-benchmarking/std",
|
||||
@@ -60,10 +60,10 @@ std = [
|
||||
"tracing/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"bp-header-chain/runtime-benchmarks",
|
||||
"bp-header-pez-chain/runtime-benchmarks",
|
||||
"bp-messages/runtime-benchmarks",
|
||||
"bp-runtime/runtime-benchmarks",
|
||||
"bp-runtime/test-helpers",
|
||||
"pezbp-runtime/runtime-benchmarks",
|
||||
"pezbp-runtime/test-helpers",
|
||||
"bp-test-utils/runtime-benchmarks",
|
||||
"pezframe-benchmarking/runtime-benchmarks",
|
||||
"pezframe-support/runtime-benchmarks",
|
||||
@@ -81,4 +81,4 @@ try-runtime = [
|
||||
"pezpallet-bridge-grandpa/try-runtime",
|
||||
"pezsp-runtime/try-runtime",
|
||||
]
|
||||
test-helpers = ["bp-runtime/test-helpers", "pezsp-trie"]
|
||||
test-helpers = ["pezbp-runtime/test-helpers", "pezsp-trie"]
|
||||
|
||||
@@ -85,7 +85,7 @@ proofs. Other bridges may use transaction proofs, Bizinikiwi header digests or a
|
||||
|
||||
**IMPORTANT NOTE**: everything below in this chapter describes details of the messages module configuration. But if
|
||||
you're interested in well-probed and relatively easy integration of two Bizinikiwi-based chains, you may want to look at
|
||||
the [bridge-runtime-common](../../bin/runtime-common/) crate. This crate is providing a lot of helpers for integration,
|
||||
the [pezbridge-runtime-common](../../bin/runtime-common/) crate. This crate is providing a lot of helpers for integration,
|
||||
which may be directly used from within your runtime. Then if you'll decide to change something in this scheme, get back
|
||||
here for detailed information.
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ use bp_messages::{
|
||||
InboundLaneData, LaneState, MessageNonce, OutboundLaneData, UnrewardedRelayer,
|
||||
UnrewardedRelayersState,
|
||||
};
|
||||
use bp_runtime::{AccountIdOf, HashOf, UnverifiedStorageProofParams};
|
||||
use pezbp_runtime::{AccountIdOf, HashOf, UnverifiedStorageProofParams};
|
||||
use codec::Decode;
|
||||
use pezframe_benchmarking::{account, v2::*};
|
||||
use pezframe_support::weights::Weight;
|
||||
|
||||
@@ -23,7 +23,7 @@ use bp_messages::{
|
||||
MessageNonce, MessagesCallInfo, ReceiveMessagesDeliveryProofInfo, ReceiveMessagesProofInfo,
|
||||
UnrewardedRelayerOccupation,
|
||||
};
|
||||
use bp_runtime::{AccountIdOf, OwnedBridgeModule};
|
||||
use pezbp_runtime::{AccountIdOf, OwnedBridgeModule};
|
||||
use pezframe_support::{dispatch::CallableCallFor, traits::IsSubType};
|
||||
use pezsp_runtime::transaction_validity::TransactionValidity;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ use bp_messages::{
|
||||
ChainWithMessages, DeliveredMessages, InboundLaneData, LaneState, MessageKey, MessageNonce,
|
||||
OutboundLaneData, ReceptionResult, UnrewardedRelayer,
|
||||
};
|
||||
use bp_runtime::AccountIdOf;
|
||||
use pezbp_runtime::AccountIdOf;
|
||||
use codec::{Decode, Encode, EncodeLike, MaxEncodedLen};
|
||||
use scale_info::{Type, TypeInfo};
|
||||
use pezsp_runtime::RuntimeDebug;
|
||||
|
||||
@@ -24,7 +24,7 @@ use bp_messages::{
|
||||
target_chain::MessageDispatch, ChainWithMessages, InboundLaneData, LaneState, MessageKey,
|
||||
MessageNonce, OutboundLaneData,
|
||||
};
|
||||
use bp_runtime::AccountIdOf;
|
||||
use pezbp_runtime::AccountIdOf;
|
||||
use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
|
||||
use pezframe_support::{ensure, pezsp_runtime::RuntimeDebug, PalletError};
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
@@ -50,7 +50,7 @@ pub use weights_ext::{
|
||||
EXPECTED_DEFAULT_MESSAGE_LENGTH, EXTRA_STORAGE_PROOF_SIZE,
|
||||
};
|
||||
|
||||
use bp_header_chain::HeaderChain;
|
||||
use bp_header_pez_chain::HeaderChain;
|
||||
use bp_messages::{
|
||||
source_chain::{
|
||||
DeliveryConfirmationPayments, FromBridgedChainMessagesDeliveryProof, OnMessagesDelivered,
|
||||
@@ -64,7 +64,7 @@ use bp_messages::{
|
||||
MessageNonce, MessagePayload, MessagesOperatingMode, OutboundLaneData, OutboundMessageDetails,
|
||||
UnrewardedRelayersState, VerificationError,
|
||||
};
|
||||
use bp_runtime::{
|
||||
use pezbp_runtime::{
|
||||
AccountIdOf, BasicOperatingMode, HashOf, OwnedBridgeModule, PreComputedSize, RangeInclusiveExt,
|
||||
Size,
|
||||
};
|
||||
@@ -98,7 +98,7 @@ pub const LOG_TARGET: &str = "runtime::bridge-messages";
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
use bp_messages::{LaneIdType, ReceivedMessages, ReceptionResult};
|
||||
use bp_runtime::RangeInclusiveExt;
|
||||
use pezbp_runtime::RangeInclusiveExt;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
@@ -497,7 +497,7 @@ pub mod pallet {
|
||||
/// Error confirming messages receival.
|
||||
ReceptionConfirmation(ReceptionConfirmationError),
|
||||
/// Error generated by the `OwnedBridgeModule` trait.
|
||||
BridgeModule(bp_runtime::OwnedBridgeModuleError),
|
||||
BridgeModule(pezbp_runtime::OwnedBridgeModuleError),
|
||||
}
|
||||
|
||||
/// Optional pallet owner.
|
||||
|
||||
@@ -31,7 +31,7 @@ pub mod v0 {
|
||||
use super::Config;
|
||||
use crate::BridgedChainOf;
|
||||
use bp_messages::{MessageNonce, UnrewardedRelayer};
|
||||
use bp_runtime::AccountIdOf;
|
||||
use pezbp_runtime::AccountIdOf;
|
||||
use codec::{Decode, Encode};
|
||||
use pezsp_std::collections::vec_deque::VecDeque;
|
||||
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
|
||||
use crate::{BridgedChainOf, BridgedHeaderChainOf, Config};
|
||||
|
||||
use bp_header_chain::{HeaderChain, HeaderChainError};
|
||||
use bp_header_pez_chain::{HeaderChain, HeaderChainError};
|
||||
use bp_messages::{
|
||||
source_chain::FromBridgedChainMessagesDeliveryProof,
|
||||
target_chain::{FromBridgedChainMessagesProof, ProvedLaneMessages, ProvedMessages},
|
||||
ChainWithMessages, InboundLaneData, Message, MessageKey, MessageNonce, MessagePayload,
|
||||
OutboundLaneData, VerificationError,
|
||||
};
|
||||
use bp_runtime::{
|
||||
use pezbp_runtime::{
|
||||
HashOf, HasherOf, RangeInclusiveExt, RawStorageProof, StorageProofChecker, StorageProofError,
|
||||
};
|
||||
use codec::Decode;
|
||||
@@ -216,9 +216,9 @@ mod tests {
|
||||
mock::*,
|
||||
};
|
||||
|
||||
use bp_header_chain::{HeaderChainError, StoredHeaderDataBuilder};
|
||||
use bp_header_pez_chain::{HeaderChainError, StoredHeaderDataBuilder};
|
||||
use bp_messages::LaneState;
|
||||
use bp_runtime::{HeaderId, StorageProofError};
|
||||
use pezbp_runtime::{HeaderId, StorageProofError};
|
||||
use codec::Encode;
|
||||
use pezsp_runtime::traits::Header;
|
||||
|
||||
@@ -236,7 +236,7 @@ mod tests {
|
||||
test_lane_id(),
|
||||
1..=nonces_end,
|
||||
outbound_lane_data,
|
||||
bp_runtime::UnverifiedStorageProofParams::default(),
|
||||
pezbp_runtime::UnverifiedStorageProofParams::default(),
|
||||
generate_dummy_message,
|
||||
encode_message,
|
||||
encode_outbound_lane_data,
|
||||
|
||||
@@ -20,7 +20,7 @@ use bp_messages::{
|
||||
storage_keys, ChainWithMessages, InboundLaneData, MessageKey, MessageNonce, MessagePayload,
|
||||
OutboundLaneData,
|
||||
};
|
||||
use bp_runtime::{
|
||||
use pezbp_runtime::{
|
||||
grow_storage_value, record_all_trie_keys, AccountIdOf, Chain, HashOf, HasherOf,
|
||||
RawStorageProof, UnverifiedStorageProofParams,
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ use crate::{
|
||||
Config, StoredMessagePayload,
|
||||
};
|
||||
|
||||
use bp_header_chain::{ChainWithGrandpa, StoredHeaderData};
|
||||
use bp_header_pez_chain::{ChainWithGrandpa, StoredHeaderData};
|
||||
use bp_messages::{
|
||||
calc_relayers_rewards,
|
||||
source_chain::{
|
||||
@@ -39,7 +39,7 @@ use bp_messages::{
|
||||
Message, MessageKey, MessageNonce, OutboundLaneData, UnrewardedRelayer,
|
||||
UnrewardedRelayersState,
|
||||
};
|
||||
use bp_runtime::{
|
||||
use pezbp_runtime::{
|
||||
messages::MessageDispatchResult, Chain, ChainId, Size, UnverifiedStorageProofParams,
|
||||
};
|
||||
use codec::{Decode, DecodeWithMemTracking, Encode};
|
||||
@@ -215,7 +215,7 @@ impl crate::benchmarking::Config<()> for TestRuntime {
|
||||
fn prepare_message_proof(
|
||||
params: crate::benchmarking::MessageProofParams<Self::LaneId>,
|
||||
) -> (FromBridgedChainMessagesProof<BridgedHeaderHash, Self::LaneId>, Weight) {
|
||||
use bp_runtime::RangeInclusiveExt;
|
||||
use pezbp_runtime::RangeInclusiveExt;
|
||||
|
||||
let dispatch_weight =
|
||||
REGULAR_PAYLOAD.declared_weight * params.message_nonces.saturating_len();
|
||||
@@ -324,11 +324,11 @@ impl DeliveryConfirmationPayments<AccountId, TestLaneIdType> for TestDeliveryCon
|
||||
|
||||
fn pay_reward(
|
||||
_lane_id: TestLaneIdType,
|
||||
messages_relayers: VecDeque<UnrewardedRelayer<AccountId>>,
|
||||
pez_messages_relayers: VecDeque<UnrewardedRelayer<AccountId>>,
|
||||
_confirmation_relayer: &AccountId,
|
||||
received_range: &RangeInclusive<MessageNonce>,
|
||||
) -> MessageNonce {
|
||||
let relayers_rewards = calc_relayers_rewards(messages_relayers, received_range);
|
||||
let relayers_rewards = calc_relayers_rewards(pez_messages_relayers, received_range);
|
||||
let rewarded_relayers = relayers_rewards.len();
|
||||
for (relayer, reward) in &relayers_rewards {
|
||||
let key = (b":relayer-reward:", relayer, reward).encode();
|
||||
|
||||
@@ -34,7 +34,7 @@ use bp_messages::{
|
||||
OutboundLaneData, OutboundMessageDetails, UnrewardedRelayer, UnrewardedRelayersState,
|
||||
VerificationError,
|
||||
};
|
||||
use bp_runtime::{BasicOperatingMode, PreComputedSize, RangeInclusiveExt, Size};
|
||||
use pezbp_runtime::{BasicOperatingMode, PreComputedSize, RangeInclusiveExt, Size};
|
||||
use bp_test_utils::generate_owned_bridge_module_tests;
|
||||
use codec::Encode;
|
||||
use pezframe_support::{
|
||||
@@ -140,7 +140,7 @@ fn pezpallet_rejects_transactions_if_halted() {
|
||||
1,
|
||||
REGULAR_PAYLOAD.declared_weight,
|
||||
),
|
||||
Error::<TestRuntime, ()>::BridgeModule(bp_runtime::OwnedBridgeModuleError::Halted),
|
||||
Error::<TestRuntime, ()>::BridgeModule(pezbp_runtime::OwnedBridgeModuleError::Halted),
|
||||
);
|
||||
|
||||
let delivery_proof = prepare_messages_delivery_proof(
|
||||
@@ -162,7 +162,7 @@ fn pezpallet_rejects_transactions_if_halted() {
|
||||
last_delivered_nonce: 1,
|
||||
},
|
||||
),
|
||||
Error::<TestRuntime, ()>::BridgeModule(bp_runtime::OwnedBridgeModuleError::Halted),
|
||||
Error::<TestRuntime, ()>::BridgeModule(pezbp_runtime::OwnedBridgeModuleError::Halted),
|
||||
);
|
||||
assert_ok!(Pallet::<TestRuntime>::do_try_state());
|
||||
});
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
use crate::weights::WeightInfo;
|
||||
|
||||
use bp_messages::{MessageNonce, UnrewardedRelayersState};
|
||||
use bp_runtime::{PreComputedSize, Size};
|
||||
use pezbp_runtime::{PreComputedSize, Size};
|
||||
use pezframe_support::weights::Weight;
|
||||
|
||||
/// Size of the message being delivered in benchmarks.
|
||||
|
||||
@@ -18,10 +18,10 @@ scale-info = { features = ["derive"], workspace = true }
|
||||
tracing = { workspace = true }
|
||||
|
||||
# Bridge dependencies
|
||||
bp-header-chain = { workspace = true }
|
||||
bp-header-pez-chain = { workspace = true }
|
||||
bp-messages = { workspace = true }
|
||||
bp-relayers = { workspace = true }
|
||||
bp-runtime = { workspace = true }
|
||||
pezbp-runtime = { workspace = true }
|
||||
pezpallet-bridge-grandpa = { workspace = true }
|
||||
pezpallet-bridge-messages = { workspace = true }
|
||||
pezpallet-bridge-teyrchains = { workspace = true }
|
||||
@@ -46,11 +46,11 @@ pezsp-io = { workspace = true }
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"bp-header-chain/std",
|
||||
"bp-header-pez-chain/std",
|
||||
"bp-messages/std",
|
||||
"bp-pezkuwi-core/std",
|
||||
"bp-relayers/std",
|
||||
"bp-runtime/std",
|
||||
"pezbp-runtime/std",
|
||||
"bp-test-utils/std",
|
||||
"bp-teyrchains/std",
|
||||
"codec/std",
|
||||
@@ -70,11 +70,11 @@ std = [
|
||||
"tracing/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"bp-header-chain/runtime-benchmarks",
|
||||
"bp-header-pez-chain/runtime-benchmarks",
|
||||
"bp-messages/runtime-benchmarks",
|
||||
"bp-pezkuwi-core/runtime-benchmarks",
|
||||
"bp-relayers/runtime-benchmarks",
|
||||
"bp-runtime/runtime-benchmarks",
|
||||
"pezbp-runtime/runtime-benchmarks",
|
||||
"bp-test-utils/runtime-benchmarks",
|
||||
"bp-teyrchains/runtime-benchmarks",
|
||||
"pezframe-benchmarking/runtime-benchmarks",
|
||||
|
||||
@@ -22,7 +22,7 @@ use crate::{
|
||||
};
|
||||
|
||||
use bp_relayers::{BatchCallUnpacker, ExtensionCallData, ExtensionCallInfo, ExtensionConfig};
|
||||
use bp_runtime::{Chain, StaticStrProvider};
|
||||
use pezbp_runtime::{Chain, StaticStrProvider};
|
||||
use core::marker::PhantomData;
|
||||
use pezframe_support::dispatch::{DispatchInfo, PostDispatchInfo};
|
||||
use pezframe_system::Config as SystemConfig;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
use crate::{extension::verify_messages_call_succeeded, Config as BridgeRelayersConfig};
|
||||
|
||||
use bp_relayers::{ExtensionCallData, ExtensionCallInfo, ExtensionConfig};
|
||||
use bp_runtime::StaticStrProvider;
|
||||
use pezbp_runtime::StaticStrProvider;
|
||||
use core::marker::PhantomData;
|
||||
use pezframe_support::dispatch::{DispatchInfo, PostDispatchInfo};
|
||||
use pezpallet_bridge_messages::{
|
||||
|
||||
@@ -29,7 +29,7 @@ use bp_relayers::{
|
||||
ExplicitOrAccountParams, ExtensionCallData, ExtensionCallInfo, ExtensionConfig,
|
||||
RewardsAccountOwner, RewardsAccountParams,
|
||||
};
|
||||
use bp_runtime::{Chain, RangeInclusiveExt, StaticStrProvider};
|
||||
use pezbp_runtime::{Chain, RangeInclusiveExt, StaticStrProvider};
|
||||
use codec::{Decode, DecodeWithMemTracking, Encode};
|
||||
use core::{fmt::Debug, marker::PhantomData};
|
||||
use pezframe_support::{
|
||||
@@ -86,7 +86,7 @@ impl<AccountId, RemoteGrandpaChainBlockNumber: Debug, LaneId: Clone + Copy + Deb
|
||||
#[cfg(test)]
|
||||
pub fn submit_finality_proof_info_mut(
|
||||
&mut self,
|
||||
) -> Option<&mut bp_header_chain::SubmitFinalityProofInfo<RemoteGrandpaChainBlockNumber>> {
|
||||
) -> Option<&mut bp_header_pez_chain::SubmitFinalityProofInfo<RemoteGrandpaChainBlockNumber>> {
|
||||
match self.call_info {
|
||||
ExtensionCallInfo::AllFinalityAndMsgs(ref mut info, _, _) => Some(info),
|
||||
ExtensionCallInfo::RelayFinalityAndMsgs(ref mut info, _) => Some(info),
|
||||
@@ -454,7 +454,7 @@ mod tests {
|
||||
use super::*;
|
||||
use crate::mock::*;
|
||||
|
||||
use bp_header_chain::{StoredHeaderDataBuilder, SubmitFinalityProofInfo};
|
||||
use bp_header_pez_chain::{StoredHeaderDataBuilder, SubmitFinalityProofInfo};
|
||||
use bp_messages::{
|
||||
source_chain::FromBridgedChainMessagesDeliveryProof,
|
||||
target_chain::FromBridgedChainMessagesProof, BaseMessagesProofInfo, DeliveredMessages,
|
||||
@@ -464,7 +464,7 @@ mod tests {
|
||||
};
|
||||
use bp_pezkuwi_core::teyrchains::{ParaHeadsProof, ParaId};
|
||||
use bp_relayers::RuntimeWithUtilityPallet;
|
||||
use bp_runtime::{BasicOperatingMode, HeaderId, Teyrchain};
|
||||
use pezbp_runtime::{BasicOperatingMode, HeaderId, Teyrchain};
|
||||
use bp_test_utils::{make_default_justification, test_keyring, TEST_GRANDPA_SET_ID};
|
||||
use bp_teyrchains::{BestParaHeadHash, ParaInfo, SubmitTeyrchainHeadsInfo};
|
||||
use pezframe_support::{
|
||||
@@ -499,9 +499,9 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
bp_runtime::generate_static_str_provider!(TestGrandpaExtension);
|
||||
bp_runtime::generate_static_str_provider!(TestExtension);
|
||||
bp_runtime::generate_static_str_provider!(TestMessagesExtension);
|
||||
pezbp_runtime::generate_static_str_provider!(TestGrandpaExtension);
|
||||
pezbp_runtime::generate_static_str_provider!(TestExtension);
|
||||
pezbp_runtime::generate_static_str_provider!(TestMessagesExtension);
|
||||
|
||||
type TestGrandpaExtensionConfig = grandpa_adapter::WithGrandpaChainExtensionConfig<
|
||||
StrTestGrandpaExtension,
|
||||
|
||||
@@ -52,7 +52,7 @@ mod integrity_tests {
|
||||
use super::{compute_priority_boost, ItemCount};
|
||||
|
||||
use bp_messages::MessageNonce;
|
||||
use bp_runtime::PreComputedSize;
|
||||
use pezbp_runtime::PreComputedSize;
|
||||
use pezframe_support::{
|
||||
dispatch::{DispatchClass, DispatchInfo, Pays, PostDispatchInfo},
|
||||
traits::Get,
|
||||
@@ -142,7 +142,7 @@ mod integrity_tests {
|
||||
pub mod per_relay_header {
|
||||
use super::*;
|
||||
|
||||
use bp_header_chain::{
|
||||
use bp_header_pez_chain::{
|
||||
max_expected_submit_finality_proof_arguments_size, ChainWithGrandpa,
|
||||
};
|
||||
use pezpallet_bridge_grandpa::WeightInfoExt;
|
||||
@@ -231,7 +231,7 @@ mod integrity_tests {
|
||||
pub mod per_teyrchain_header {
|
||||
use super::*;
|
||||
|
||||
use bp_runtime::Teyrchain;
|
||||
use pezbp_runtime::Teyrchain;
|
||||
use pezpallet_bridge_teyrchains::WeightInfoExt;
|
||||
|
||||
/// Ensures that the value of `PriorityBoostPerHeader` matches the value of
|
||||
|
||||
@@ -25,7 +25,7 @@ use crate::{
|
||||
};
|
||||
|
||||
use bp_relayers::{BatchCallUnpacker, ExtensionCallData, ExtensionCallInfo, ExtensionConfig};
|
||||
use bp_runtime::{StaticStrProvider, Teyrchain};
|
||||
use pezbp_runtime::{StaticStrProvider, Teyrchain};
|
||||
use core::marker::PhantomData;
|
||||
use pezframe_support::dispatch::{DispatchInfo, PostDispatchInfo};
|
||||
use pezframe_system::Config as SystemConfig;
|
||||
|
||||
@@ -23,7 +23,7 @@ extern crate alloc;
|
||||
|
||||
pub use bp_relayers::RewardLedger;
|
||||
use bp_relayers::{PaymentProcedure, Registration, RelayerRewardsKeyProvider, StakeAndSlash};
|
||||
use bp_runtime::StorageDoubleMapKeyProvider;
|
||||
use pezbp_runtime::StorageDoubleMapKeyProvider;
|
||||
use core::marker::PhantomData;
|
||||
use pezframe_support::{fail, traits::tokens::Balance};
|
||||
use pezsp_arithmetic::traits::{AtLeast32BitUnsigned, Zero};
|
||||
|
||||
@@ -30,7 +30,7 @@ pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(2);
|
||||
pub mod v0 {
|
||||
use crate::{Config, Pallet};
|
||||
use bp_relayers::RewardsAccountOwner;
|
||||
use bp_runtime::{ChainId, StorageDoubleMapKeyProvider};
|
||||
use pezbp_runtime::{ChainId, StorageDoubleMapKeyProvider};
|
||||
use codec::{Codec, Decode, Encode, EncodeLike, MaxEncodedLen};
|
||||
use core::marker::PhantomData;
|
||||
use pezframe_support::{pezpallet_prelude::OptionQuery, Blake2_128Concat, Identity};
|
||||
@@ -122,7 +122,7 @@ pub mod v1 {
|
||||
use crate::{Config, Pallet};
|
||||
use bp_messages::LaneIdType;
|
||||
use bp_relayers::RewardsAccountParams;
|
||||
use bp_runtime::StorageDoubleMapKeyProvider;
|
||||
use pezbp_runtime::StorageDoubleMapKeyProvider;
|
||||
use codec::{Codec, EncodeLike};
|
||||
use core::marker::PhantomData;
|
||||
use pezframe_support::{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
use crate as pezpallet_bridge_relayers;
|
||||
|
||||
use bp_header_chain::ChainWithGrandpa;
|
||||
use bp_header_pez_chain::ChainWithGrandpa;
|
||||
use bp_messages::{
|
||||
target_chain::{DispatchMessage, MessageDispatch},
|
||||
ChainWithMessages, HashedLaneId, LaneIdType, MessageNonce,
|
||||
@@ -26,7 +26,7 @@ use bp_messages::{
|
||||
use bp_relayers::{
|
||||
PayRewardFromAccount, PaymentProcedure, RewardsAccountOwner, RewardsAccountParams,
|
||||
};
|
||||
use bp_runtime::{messages::MessageDispatchResult, Chain, ChainId, Teyrchain};
|
||||
use pezbp_runtime::{messages::MessageDispatchResult, Chain, ChainId, Teyrchain};
|
||||
use bp_teyrchains::SingleParaStoredHeaderDataBuilder;
|
||||
use codec::Encode;
|
||||
use pezframe_support::{
|
||||
|
||||
@@ -26,7 +26,7 @@ use bp_messages::{
|
||||
};
|
||||
pub use bp_relayers::PayRewardFromAccount;
|
||||
use bp_relayers::{RewardsAccountOwner, RewardsAccountParams};
|
||||
use bp_runtime::Chain;
|
||||
use pezbp_runtime::Chain;
|
||||
use core::{marker::PhantomData, ops::RangeInclusive};
|
||||
use pezframe_support::{pezsp_runtime::SaturatedConversion, traits::Get};
|
||||
use pezpallet_bridge_messages::LaneIdOf;
|
||||
@@ -51,12 +51,12 @@ where
|
||||
|
||||
fn pay_reward(
|
||||
lane_id: LaneIdOf<T, MI>,
|
||||
messages_relayers: VecDeque<bp_messages::UnrewardedRelayer<T::AccountId>>,
|
||||
pez_messages_relayers: VecDeque<bp_messages::UnrewardedRelayer<T::AccountId>>,
|
||||
confirmation_relayer: &T::AccountId,
|
||||
received_range: &RangeInclusive<bp_messages::MessageNonce>,
|
||||
) -> MessageNonce {
|
||||
let relayers_rewards =
|
||||
bp_messages::calc_relayers_rewards::<T::AccountId>(messages_relayers, received_range);
|
||||
bp_messages::calc_relayers_rewards::<T::AccountId>(pez_messages_relayers, received_range);
|
||||
let rewarded_relayers = relayers_rewards.len();
|
||||
|
||||
register_relayers_rewards::<T, RI, MI>(
|
||||
|
||||
@@ -18,9 +18,9 @@ scale-info = { features = ["derive"], workspace = true }
|
||||
tracing = { workspace = true }
|
||||
|
||||
# Bridge Dependencies
|
||||
bp-header-chain = { workspace = true }
|
||||
bp-header-pez-chain = { workspace = true }
|
||||
bp-pezkuwi-core = { workspace = true }
|
||||
bp-runtime = { workspace = true }
|
||||
pezbp-runtime = { workspace = true }
|
||||
bp-teyrchains = { workspace = true }
|
||||
pezpallet-bridge-grandpa = { workspace = true }
|
||||
|
||||
@@ -32,7 +32,7 @@ pezsp-runtime = { workspace = true }
|
||||
pezsp-std = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
bp-header-chain = { workspace = true, default-features = true }
|
||||
bp-header-pez-chain = { workspace = true, default-features = true }
|
||||
bp-test-utils = { workspace = true, default-features = true }
|
||||
pezsp-core = { workspace = true, default-features = true }
|
||||
pezsp-io = { workspace = true, default-features = true }
|
||||
@@ -40,9 +40,9 @@ pezsp-io = { workspace = true, default-features = true }
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"bp-header-chain/std",
|
||||
"bp-header-pez-chain/std",
|
||||
"bp-pezkuwi-core/std",
|
||||
"bp-runtime/std",
|
||||
"pezbp-runtime/std",
|
||||
"bp-teyrchains/std",
|
||||
"codec/std",
|
||||
"pezframe-benchmarking/std",
|
||||
@@ -55,9 +55,9 @@ std = [
|
||||
"tracing/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"bp-header-chain/runtime-benchmarks",
|
||||
"bp-header-pez-chain/runtime-benchmarks",
|
||||
"bp-pezkuwi-core/runtime-benchmarks",
|
||||
"bp-runtime/runtime-benchmarks",
|
||||
"pezbp-runtime/runtime-benchmarks",
|
||||
"bp-test-utils/runtime-benchmarks",
|
||||
"bp-teyrchains/runtime-benchmarks",
|
||||
"pezframe-benchmarking/runtime-benchmarks",
|
||||
|
||||
@@ -22,7 +22,7 @@ use crate::{
|
||||
};
|
||||
|
||||
use bp_pezkuwi_core::teyrchains::{ParaHash, ParaHeadsProof, ParaId};
|
||||
use bp_runtime::UnverifiedStorageProofParams;
|
||||
use pezbp_runtime::UnverifiedStorageProofParams;
|
||||
use pezframe_benchmarking::{account, benchmarks_instance_pallet};
|
||||
use pezframe_system::RawOrigin;
|
||||
use pezsp_std::prelude::*;
|
||||
@@ -46,7 +46,7 @@ benchmarks_instance_pallet! {
|
||||
where_clause {
|
||||
where
|
||||
<T as pezpallet_bridge_grandpa::Config<T::BridgesGrandpaPalletInstance>>::BridgedChain:
|
||||
bp_runtime::Chain<
|
||||
pezbp_runtime::Chain<
|
||||
BlockNumber = RelayBlockNumber,
|
||||
Hash = RelayBlockHash,
|
||||
Hasher = RelayBlockHasher,
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::{Config, GrandpaPalletOf, Pallet, RelayBlockNumber};
|
||||
use bp_header_chain::HeaderChain;
|
||||
use bp_runtime::{HeaderId, OwnedBridgeModule};
|
||||
use bp_header_pez_chain::HeaderChain;
|
||||
use pezbp_runtime::{HeaderId, OwnedBridgeModule};
|
||||
use bp_teyrchains::{BestParaHeadHash, SubmitTeyrchainHeadsInfo};
|
||||
use pezframe_support::{
|
||||
dispatch::CallableCallFor,
|
||||
@@ -258,9 +258,9 @@ mod tests {
|
||||
mock::{run_test, FreeHeadersInterval, RuntimeCall, TestRuntime},
|
||||
CallSubType, PalletOperatingMode, ParaInfo, ParasInfo, RelayBlockHash, RelayBlockNumber,
|
||||
};
|
||||
use bp_header_chain::StoredHeaderData;
|
||||
use bp_header_pez_chain::StoredHeaderData;
|
||||
use bp_pezkuwi_core::teyrchains::{ParaHash, ParaHeadsProof, ParaId};
|
||||
use bp_runtime::BasicOperatingMode;
|
||||
use pezbp_runtime::BasicOperatingMode;
|
||||
use bp_teyrchains::BestParaHeadHash;
|
||||
|
||||
fn validate_submit_teyrchain_heads(
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
pub use weights::WeightInfo;
|
||||
pub use weights_ext::WeightInfoExt;
|
||||
|
||||
use bp_header_chain::{HeaderChain, HeaderChainError};
|
||||
use bp_header_pez_chain::{HeaderChain, HeaderChainError};
|
||||
use bp_pezkuwi_core::teyrchains::{ParaHash, ParaHead, ParaHeadsProof, ParaId};
|
||||
use bp_runtime::{Chain, HashOf, HeaderId, HeaderIdOf, Teyrchain};
|
||||
use pezbp_runtime::{Chain, HashOf, HeaderId, HeaderIdOf, Teyrchain};
|
||||
use bp_teyrchains::{
|
||||
ParaInfo, ParaStoredHeaderData, RelayBlockHash, RelayBlockHasher, RelayBlockNumber,
|
||||
SubmitTeyrchainHeadsInfo,
|
||||
@@ -40,7 +40,7 @@ use proofs::{StorageProofAdapter, TeyrchainsStorageProofAdapter};
|
||||
use pezsp_std::{marker::PhantomData, vec::Vec};
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
use bp_runtime::HeaderOf;
|
||||
use pezbp_runtime::HeaderOf;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
use bp_teyrchains::ParaStoredHeaderDataBuilder;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
@@ -75,7 +75,7 @@ struct UpdateTeyrchainHeadArtifacts {
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
use bp_runtime::{
|
||||
use pezbp_runtime::{
|
||||
BasicOperatingMode, BoundedStorageValue, OwnedBridgeModule, StorageDoubleMapKeyProvider,
|
||||
StorageMapKeyProvider,
|
||||
};
|
||||
@@ -153,7 +153,7 @@ pub mod pallet {
|
||||
/// Teyrchain heads storage proof is invalid.
|
||||
HeaderChainStorageProof(HeaderChainError),
|
||||
/// Error generated by the `OwnedBridgeModule` trait.
|
||||
BridgeModule(bp_runtime::OwnedBridgeModuleError),
|
||||
BridgeModule(pezbp_runtime::OwnedBridgeModuleError),
|
||||
}
|
||||
|
||||
/// Convenience trait for defining `BridgedChain` bounds.
|
||||
@@ -797,7 +797,7 @@ pub fn initialize_for_benchmarks<T: Config<I>, I: 'static, PC: Teyrchain<Hash =
|
||||
header: HeaderOf<PC>,
|
||||
) {
|
||||
use bp_pezkuwi_core::teyrchains::ParaHead;
|
||||
use bp_runtime::HeaderIdProvider;
|
||||
use pezbp_runtime::HeaderIdProvider;
|
||||
use pezsp_runtime::traits::Header;
|
||||
|
||||
let relay_head =
|
||||
@@ -837,9 +837,9 @@ pub(crate) mod tests {
|
||||
use bp_test_utils::prepare_teyrchain_heads_proof;
|
||||
use codec::Encode;
|
||||
|
||||
use bp_header_chain::{justification::GrandpaJustification, StoredHeaderGrandpaInfo};
|
||||
use bp_header_pez_chain::{justification::GrandpaJustification, StoredHeaderGrandpaInfo};
|
||||
use bp_pezkuwi_core::teyrchains::ParaHead;
|
||||
use bp_runtime::{
|
||||
use pezbp_runtime::{
|
||||
BasicOperatingMode, OwnedBridgeModuleError, StorageDoubleMapKeyProvider,
|
||||
StorageMapKeyProvider, StorageProofError,
|
||||
};
|
||||
@@ -870,7 +870,7 @@ pub(crate) mod tests {
|
||||
pezpallet_bridge_grandpa::FreeHeadersRemaining::<TestRuntime, BridgesGrandpaPalletInstance>::set(Some(100));
|
||||
pezpallet_bridge_grandpa::Pallet::<TestRuntime, BridgesGrandpaPalletInstance>::initialize(
|
||||
RuntimeOrigin::root(),
|
||||
bp_header_chain::InitializationData {
|
||||
bp_header_pez_chain::InitializationData {
|
||||
header: Box::new(test_relay_header(0, state_root)),
|
||||
authority_list: authority_list(),
|
||||
set_id: 1,
|
||||
|
||||
@@ -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/>.
|
||||
|
||||
use bp_header_chain::ChainWithGrandpa;
|
||||
use bp_header_pez_chain::ChainWithGrandpa;
|
||||
use bp_pezkuwi_core::teyrchains::ParaId;
|
||||
use bp_runtime::{Chain, ChainId, Teyrchain};
|
||||
use pezbp_runtime::{Chain, ChainId, Teyrchain};
|
||||
use pezframe_support::{
|
||||
construct_runtime, derive_impl, parameter_types, traits::ConstU32, weights::Weight,
|
||||
};
|
||||
@@ -231,7 +231,7 @@ impl pezpallet_bridge_teyrchains::benchmarking::Config<()> for TestRuntime {
|
||||
fn prepare_teyrchain_heads_proof(
|
||||
teyrchains: &[ParaId],
|
||||
_teyrchain_head_size: u32,
|
||||
_proof_params: bp_runtime::UnverifiedStorageProofParams,
|
||||
_proof_params: pezbp_runtime::UnverifiedStorageProofParams,
|
||||
) -> (
|
||||
crate::RelayBlockNumber,
|
||||
crate::RelayBlockHash,
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
//! Tools for teyrchain head proof verification.
|
||||
|
||||
use crate::{Config, GrandpaPalletOf, RelayBlockHash, RelayBlockHasher};
|
||||
use bp_header_chain::{HeaderChain, HeaderChainError};
|
||||
use bp_header_pez_chain::{HeaderChain, HeaderChainError};
|
||||
use bp_pezkuwi_core::teyrchains::{ParaHead, ParaId};
|
||||
use bp_runtime::{RawStorageProof, StorageProofChecker, StorageProofError};
|
||||
use pezbp_runtime::{RawStorageProof, StorageProofChecker, StorageProofError};
|
||||
use bp_teyrchains::teyrchain_head_storage_key_at_source;
|
||||
use codec::Decode;
|
||||
use pezframe_support::traits::Get;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
use crate::weights::{BridgeWeight, WeightInfo};
|
||||
|
||||
use bp_runtime::Size;
|
||||
use pezbp_runtime::Size;
|
||||
use pezframe_support::weights::{RuntimeDbWeight, Weight};
|
||||
|
||||
/// Size of the regular teyrchain head.
|
||||
|
||||
@@ -19,7 +19,7 @@ tracing = { workspace = true }
|
||||
|
||||
# Bridge Dependencies
|
||||
bp-messages = { workspace = true }
|
||||
bp-runtime = { workspace = true }
|
||||
pezbp-runtime = { workspace = true }
|
||||
bp-xcm-bridge-hub = { workspace = true }
|
||||
pezpallet-bridge-messages = { workspace = true }
|
||||
|
||||
@@ -36,7 +36,7 @@ xcm-builder = { workspace = true }
|
||||
xcm-executor = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
bp-header-chain = { workspace = true }
|
||||
bp-header-pez-chain = { workspace = true }
|
||||
bp-xcm-bridge-hub-router = { workspace = true }
|
||||
pezpallet-balances = { workspace = true }
|
||||
pezpallet-xcm-bridge-hub-router = { workspace = true }
|
||||
@@ -46,9 +46,9 @@ pezsp-io = { workspace = true }
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"bp-header-chain/std",
|
||||
"bp-header-pez-chain/std",
|
||||
"bp-messages/std",
|
||||
"bp-runtime/std",
|
||||
"pezbp-runtime/std",
|
||||
"bp-xcm-bridge-hub-router/std",
|
||||
"bp-xcm-bridge-hub/std",
|
||||
"codec/std",
|
||||
@@ -69,9 +69,9 @@ std = [
|
||||
"xcm/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"bp-header-chain/runtime-benchmarks",
|
||||
"bp-header-pez-chain/runtime-benchmarks",
|
||||
"bp-messages/runtime-benchmarks",
|
||||
"bp-runtime/runtime-benchmarks",
|
||||
"pezbp-runtime/runtime-benchmarks",
|
||||
"bp-xcm-bridge-hub-router/runtime-benchmarks",
|
||||
"bp-xcm-bridge-hub/runtime-benchmarks",
|
||||
"pezframe-support/runtime-benchmarks",
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
use crate::{Config, Pallet, LOG_TARGET};
|
||||
|
||||
use bp_messages::target_chain::{DispatchMessage, MessageDispatch};
|
||||
use bp_runtime::messages::MessageDispatchResult;
|
||||
use pezbp_runtime::messages::MessageDispatchResult;
|
||||
use bp_xcm_bridge_hub::{LocalXcmChannelManager, XcmAsPlainPayload};
|
||||
use codec::{Decode, DecodeWithMemTracking, Encode};
|
||||
use pezframe_support::{weights::Weight, CloneNoBound, EqNoBound, PartialEqNoBound};
|
||||
|
||||
@@ -371,7 +371,7 @@ mod tests {
|
||||
use super::*;
|
||||
use crate::{mock::*, Bridges, LaneToBridge, LanesManagerOf};
|
||||
|
||||
use bp_runtime::RangeInclusiveExt;
|
||||
use pezbp_runtime::RangeInclusiveExt;
|
||||
use bp_xcm_bridge_hub::{Bridge, BridgeLocations, BridgeState};
|
||||
use pezframe_support::{assert_ok, traits::EnsureOrigin};
|
||||
use pezpallet_bridge_messages::InboundLaneStorage;
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use bp_messages::{LaneState, MessageNonce};
|
||||
use bp_runtime::{AccountIdOf, BalanceOf, RangeInclusiveExt};
|
||||
use pezbp_runtime::{AccountIdOf, BalanceOf, RangeInclusiveExt};
|
||||
use bp_xcm_bridge_hub::BridgeLocationsError;
|
||||
pub use bp_xcm_bridge_hub::{
|
||||
Bridge, BridgeId, BridgeLocations, BridgeState, LocalXcmChannelManager,
|
||||
|
||||
@@ -22,7 +22,7 @@ use bp_messages::{
|
||||
target_chain::{DispatchMessage, MessageDispatch},
|
||||
ChainWithMessages, HashedLaneId, MessageNonce,
|
||||
};
|
||||
use bp_runtime::{messages::MessageDispatchResult, Chain, ChainId, HashOf};
|
||||
use pezbp_runtime::{messages::MessageDispatchResult, Chain, ChainId, HashOf};
|
||||
use bp_xcm_bridge_hub::{BridgeId, LocalXcmChannelManager};
|
||||
use codec::{Decode, Encode};
|
||||
use pezframe_support::{
|
||||
@@ -620,7 +620,7 @@ impl ChainWithMessages for BridgedUnderlyingChain {
|
||||
}
|
||||
|
||||
pub struct BridgedHeaderChain;
|
||||
impl bp_header_chain::HeaderChain<BridgedUnderlyingChain> for BridgedHeaderChain {
|
||||
impl bp_header_pez_chain::HeaderChain<BridgedUnderlyingChain> for BridgedHeaderChain {
|
||||
fn finalized_header_state_root(
|
||||
_hash: HashOf<BridgedUnderlyingChain>,
|
||||
) -> Option<HashOf<BridgedUnderlyingChain>> {
|
||||
|
||||
Reference in New Issue
Block a user