Use primitives reexported from polkadot_primitives crate root (#2067)

* Use primitives reexported from `polkadot_primitives` crate root

* restart CI

* Fixes after merge

* update lockfile for {"polkadot", "substrate"}

Co-authored-by: parity-processbot <>
This commit is contained in:
s0me0ne-unkn0wn
2023-01-11 13:06:58 +01:00
committed by GitHub
parent d0f13b042a
commit 7871193f79
44 changed files with 373 additions and 558 deletions
+5 -5
View File
@@ -376,7 +376,7 @@ pub mod pallet {
.read_upgrade_go_ahead_signal()
.expect("Invalid upgrade go ahead signal");
match upgrade_go_ahead_signal {
Some(relay_chain::v2::UpgradeGoAhead::GoAhead) => {
Some(relay_chain::UpgradeGoAhead::GoAhead) => {
assert!(
<PendingValidationCode<T>>::exists(),
"No new validation function found in storage, GoAhead signal is not expected",
@@ -389,7 +389,7 @@ pub mod pallet {
relay_chain_block_num: vfp.relay_parent_number,
});
},
Some(relay_chain::v2::UpgradeGoAhead::Abort) => {
Some(relay_chain::UpgradeGoAhead::Abort) => {
<PendingValidationCode<T>>::kill();
Self::deposit_event(Event::ValidationFunctionDiscarded);
},
@@ -546,7 +546,7 @@ pub mod pallet {
/// set after the inherent.
#[pallet::storage]
pub(super) type UpgradeRestrictionSignal<T: Config> =
StorageValue<_, Option<relay_chain::v2::UpgradeRestriction>, ValueQuery>;
StorageValue<_, Option<relay_chain::UpgradeRestriction>, ValueQuery>;
/// The state proof for the last relay parent block.
///
@@ -605,7 +605,7 @@ pub mod pallet {
/// This will be cleared in `on_initialize` of each new block.
#[pallet::storage]
pub(super) type HrmpWatermark<T: Config> =
StorageValue<_, relay_chain::v2::BlockNumber, ValueQuery>;
StorageValue<_, relay_chain::BlockNumber, ValueQuery>;
/// HRMP messages that were sent in a block.
///
@@ -828,7 +828,7 @@ impl<T: Config> Pallet<T> {
fn process_inbound_horizontal_messages(
ingress_channels: &[(ParaId, cumulus_primitives_core::AbridgedHrmpChannel)],
horizontal_messages: BTreeMap<ParaId, Vec<InboundHrmpMessage>>,
relay_parent_number: relay_chain::v2::BlockNumber,
relay_parent_number: relay_chain::BlockNumber,
) -> Weight {
// First, check that all submitted messages are sent from channels that exist. The
// channel exists if its MQC head is present in `vfp.hrmp_mqc_heads`.
@@ -149,7 +149,7 @@ impl RelayChainStateProof {
/// `proof`.
pub fn new(
para_id: ParaId,
relay_parent_storage_root: relay_chain::v2::Hash,
relay_parent_storage_root: relay_chain::Hash,
proof: StorageProof,
) -> Result<Self, Error> {
let db = proof.into_memory_db::<HashFor<relay_chain::Block>>();
@@ -195,7 +195,7 @@ impl RelayChainStateProof {
let mut ingress_channels = Vec::with_capacity(ingress_channel_index.len());
for sender in ingress_channel_index {
let channel_id = relay_chain::v2::HrmpChannelId { sender, recipient: self.para_id };
let channel_id = relay_chain::HrmpChannelId { sender, recipient: self.para_id };
let hrmp_channel: AbridgedHrmpChannel = read_entry(
&self.trie_backend,
&relay_chain::well_known_keys::hrmp_channels(channel_id),
@@ -207,7 +207,7 @@ impl RelayChainStateProof {
let mut egress_channels = Vec::with_capacity(egress_channel_index.len());
for recipient in egress_channel_index {
let channel_id = relay_chain::v2::HrmpChannelId { sender: self.para_id, recipient };
let channel_id = relay_chain::HrmpChannelId { sender: self.para_id, recipient };
let hrmp_channel: AbridgedHrmpChannel = read_entry(
&self.trie_backend,
&relay_chain::well_known_keys::hrmp_channels(channel_id),
@@ -235,12 +235,12 @@ impl RelayChainStateProof {
.map_err(Error::Config)
}
/// Read the [`Slot`](relay_chain::v2::Slot) from the relay chain state proof.
/// Read the [`Slot`](relay_chain::Slot) from the relay chain state proof.
///
/// The slot is slot of the relay chain block this state proof was extracted from.
///
/// Returns an error if anything failed at reading or decoding.
pub fn read_slot(&self) -> Result<relay_chain::v2::Slot, Error> {
pub fn read_slot(&self) -> Result<relay_chain::Slot, Error> {
read_entry(&self.trie_backend, relay_chain::well_known_keys::CURRENT_SLOT, None)
.map_err(Error::Slot)
}
@@ -254,7 +254,7 @@ impl RelayChainStateProof {
/// Returns an error if anything failed at reading or decoding.
pub fn read_upgrade_go_ahead_signal(
&self,
) -> Result<Option<relay_chain::v2::UpgradeGoAhead>, Error> {
) -> Result<Option<relay_chain::UpgradeGoAhead>, Error> {
read_optional_entry(
&self.trie_backend,
&relay_chain::well_known_keys::upgrade_go_ahead_signal(self.para_id),
@@ -270,7 +270,7 @@ impl RelayChainStateProof {
/// Returns an error if anything failed at reading or decoding.
pub fn read_upgrade_restriction_signal(
&self,
) -> Result<Option<relay_chain::v2::UpgradeRestriction>, Error> {
) -> Result<Option<relay_chain::UpgradeRestriction>, Error> {
read_optional_entry(
&self.trie_backend,
&relay_chain::well_known_keys::upgrade_restriction_signal(self.para_id),
@@ -31,7 +31,7 @@ use frame_support::{
};
use frame_system::RawOrigin;
use hex_literal::hex;
use relay_chain::v2::HrmpChannelId;
use relay_chain::HrmpChannelId;
use sp_core::H256;
use sp_runtime::{
testing::Header,
@@ -391,7 +391,7 @@ fn events() {
BlockTests::new()
.with_relay_sproof_builder(|_, block_number, builder| {
if block_number > 123 {
builder.upgrade_go_ahead = Some(relay_chain::v2::UpgradeGoAhead::GoAhead);
builder.upgrade_go_ahead = Some(relay_chain::UpgradeGoAhead::GoAhead);
}
})
.add_with_post_test(
@@ -445,7 +445,7 @@ fn manipulates_storage() {
BlockTests::new()
.with_relay_sproof_builder(|_, block_number, builder| {
if block_number > 123 {
builder.upgrade_go_ahead = Some(relay_chain::v2::UpgradeGoAhead::GoAhead);
builder.upgrade_go_ahead = Some(relay_chain::UpgradeGoAhead::GoAhead);
}
})
.add(123, || {
@@ -473,7 +473,7 @@ fn aborted_upgrade() {
BlockTests::new()
.with_relay_sproof_builder(|_, block_number, builder| {
if block_number > 123 {
builder.upgrade_go_ahead = Some(relay_chain::v2::UpgradeGoAhead::Abort);
builder.upgrade_go_ahead = Some(relay_chain::UpgradeGoAhead::Abort);
}
})
.add(123, || {
@@ -18,7 +18,7 @@
use super::MemoryOptimizedValidationParams;
use cumulus_primitives_core::{
relay_chain::v2::Hash as RHash, ParachainBlockData, PersistedValidationData,
relay_chain::Hash as RHash, ParachainBlockData, PersistedValidationData,
};
use cumulus_primitives_parachain_inherent::ParachainInherentData;
@@ -53,6 +53,6 @@ pub use sp_std;
pub struct MemoryOptimizedValidationParams {
pub parent_head: bytes::Bytes,
pub block_data: bytes::Bytes,
pub relay_parent_number: cumulus_primitives_core::relay_chain::v2::BlockNumber,
pub relay_parent_storage_root: cumulus_primitives_core::relay_chain::v2::Hash,
pub relay_parent_number: cumulus_primitives_core::relay_chain::BlockNumber,
pub relay_parent_storage_root: cumulus_primitives_core::relay_chain::Hash,
}