Skip to content

Commit

Permalink
Extract BlockNumber from parachain runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
sea212 committed Apr 27, 2024
1 parent c8d2251 commit 8416327
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 24 deletions.
44 changes: 22 additions & 22 deletions cumulus/xcm/xcm-emulator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,34 @@ edition.workspace = true
publish = false

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0" }
codec = { package = "parity-scale-codec", version = "3.6.9" }
paste = "1.0.14"
log = { version = "0.4.20", default-features = false }
log = { version = "0.4.21", default-features = false }
lazy_static = "1.4.0"
impl-trait-for-tuples = "0.2.2"

# Substrate
frame-support = { path = "../../../substrate/frame/support" }
frame-system = { path = "../../../substrate/frame/system" }
sp-io = { path = "../../../substrate/primitives/io" }
sp-core = { path = "../../../substrate/primitives/core" }
sp-std = { path = "../../../substrate/primitives/std" }
sp-runtime = { path = "../../../substrate/primitives/runtime" }
sp-arithmetic = { path = "../../../substrate/primitives/arithmetic" }
sp-tracing = { path = "../../../substrate/primitives/tracing" }
pallet-balances = { path = "../../../substrate/frame/balances" }
pallet-message-queue = { path = "../../../substrate/frame/message-queue" }
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sp-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }

# Cumulus
cumulus-primitives-core = { path = "../../primitives/core" }
cumulus-pallet-parachain-system = { path = "../../pallets/parachain-system" }
cumulus-primitives-parachain-inherent = { path = "../../primitives/parachain-inherent" }
cumulus-test-relay-sproof-builder = { path = "../../test/relay-sproof-builder" }
parachains-common = { path = "../../parachains/common" }
cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
cumulus-test-relay-sproof-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }

# Polkadot
xcm = { package = "staging-xcm", path = "../../../polkadot/xcm" }
xcm-executor = { package = "staging-xcm-executor", path = "../../../polkadot/xcm/xcm-executor" }
polkadot-primitives = { path = "../../../polkadot/primitives" }
polkadot-parachain-primitives = { path = "../../../polkadot/parachain" }
polkadot-runtime-parachains = { path = "../../../polkadot/runtime/parachains" }
xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
7 changes: 5 additions & 2 deletions cumulus/xcm/xcm-emulator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub use frame_support::{
},
weights::{Weight, WeightMeter},
};
pub use frame_system::pallet_prelude::BlockNumberFor;
pub use frame_system::{Config as SystemConfig, Pallet as SystemPallet};
pub use pallet_balances::AccountData;
pub use sp_arithmetic::traits::Bounded;
Expand All @@ -49,7 +50,7 @@ pub use cumulus_primitives_core::{
pub use cumulus_primitives_parachain_inherent::ParachainInherentData;
pub use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder;
pub use pallet_message_queue::{Config as MessageQueueConfig, Pallet as MessageQueuePallet};
pub use parachains_common::{AccountId, Balance, BlockNumber};
pub use parachains_common::{AccountId, Balance};
pub use polkadot_primitives;
pub use polkadot_runtime_parachains::inclusion::{AggregateMessageOrigin, UmpQueueId};

Expand Down Expand Up @@ -643,7 +644,9 @@ macro_rules! decl_test_parachains {
.clone()
);
<Self as Chain>::System::initialize(&block_number, &parent_head_data.hash(), &Default::default());
<<Self as Parachain>::ParachainSystem as Hooks<$crate::BlockNumber>>::on_initialize(block_number);
<<Self as Parachain>::ParachainSystem as Hooks<
$crate::BlockNumberFor<<Self as Chain>::Runtime>
>>::on_initialize(block_number);

let _ = <Self as Parachain>::ParachainSystem::set_validation_data(
<Self as Chain>::RuntimeOrigin::none(),
Expand Down

0 comments on commit 8416327

Please sign in to comment.