Refactoring Checkpoint: (WIP)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user