mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
Merge branch 'master' into gav-xcm-v3
This commit is contained in:
Generated
+260
-259
File diff suppressed because it is too large
Load Diff
@@ -37,7 +37,7 @@ use polkadot_node_primitives::{
|
||||
};
|
||||
use polkadot_node_subsystem::messages::{CollationGenerationMessage, CollatorProtocolMessage};
|
||||
use polkadot_overseer::Handle as OverseerHandle;
|
||||
use polkadot_primitives::v1::{CollatorPair, Id as ParaId};
|
||||
use polkadot_primitives::v2::{CollatorPair, Id as ParaId};
|
||||
|
||||
use codec::{Decode, Encode};
|
||||
use futures::{channel::oneshot, FutureExt};
|
||||
|
||||
@@ -9,7 +9,7 @@ edition = "2021"
|
||||
async-trait = "0.1.42"
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] }
|
||||
futures = { version = "0.3.8", features = ["compat"] }
|
||||
tracing = "0.1.31"
|
||||
tracing = "0.1.32"
|
||||
|
||||
# Substrate
|
||||
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
@@ -26,7 +26,7 @@ use codec::{Decode, Encode};
|
||||
use cumulus_client_consensus_common::{
|
||||
ParachainBlockImport, ParachainCandidate, ParachainConsensus,
|
||||
};
|
||||
use cumulus_primitives_core::{relay_chain::v1::Hash as PHash, PersistedValidationData};
|
||||
use cumulus_primitives_core::{relay_chain::v2::Hash as PHash, PersistedValidationData};
|
||||
|
||||
use futures::lock::Mutex;
|
||||
use sc_client_api::{backend::AuxStore, BlockOf};
|
||||
|
||||
@@ -8,7 +8,7 @@ edition = "2021"
|
||||
[dependencies]
|
||||
futures = { version = "0.3.8", features = ["compat"] }
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] }
|
||||
tracing = "0.1.31"
|
||||
tracing = "0.1.32"
|
||||
async-trait = "0.1.52"
|
||||
dyn-clone = "1.0.4"
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use polkadot_primitives::v1::{Hash as PHash, PersistedValidationData};
|
||||
use polkadot_primitives::v2::{Hash as PHash, PersistedValidationData};
|
||||
use sc_consensus::BlockImport;
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ use sp_runtime::{
|
||||
traits::{Block as BlockT, Header as HeaderT},
|
||||
};
|
||||
|
||||
use polkadot_primitives::v1::{Hash as PHash, Id as ParaId, OccupiedCoreAssumption};
|
||||
use polkadot_primitives::v2::{Hash as PHash, Id as ParaId, OccupiedCoreAssumption};
|
||||
|
||||
use codec::Decode;
|
||||
use futures::{select, FutureExt, Stream, StreamExt};
|
||||
|
||||
@@ -25,7 +25,7 @@ use cumulus_test_client::{
|
||||
};
|
||||
use futures::{channel::mpsc, executor::block_on, select, FutureExt, Stream, StreamExt};
|
||||
use futures_timer::Delay;
|
||||
use polkadot_primitives::v1::Id as ParaId;
|
||||
use polkadot_primitives::v2::Id as ParaId;
|
||||
use sc_client_api::UsageProvider;
|
||||
use sc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy};
|
||||
use sp_blockchain::Error as ClientError;
|
||||
|
||||
@@ -9,7 +9,7 @@ edition = "2021"
|
||||
async-trait = "0.1.42"
|
||||
futures = { version = "0.3.8", features = ["compat"] }
|
||||
parking_lot = "0.12.0"
|
||||
tracing = "0.1.31"
|
||||
tracing = "0.1.32"
|
||||
|
||||
# Substrate
|
||||
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
use cumulus_client_consensus_common::{
|
||||
ParachainBlockImport, ParachainCandidate, ParachainConsensus,
|
||||
};
|
||||
use cumulus_primitives_core::{relay_chain::v1::Hash as PHash, ParaId, PersistedValidationData};
|
||||
use cumulus_primitives_core::{relay_chain::v2::Hash as PHash, ParaId, PersistedValidationData};
|
||||
use cumulus_relay_chain_interface::RelayChainInterface;
|
||||
use parking_lot::Mutex;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ derive_more = "0.99.2"
|
||||
futures = { version = "0.3.1", features = ["compat"] }
|
||||
futures-timer = "3.0.2"
|
||||
parking_lot = "0.12.0"
|
||||
tracing = "0.1.31"
|
||||
tracing = "0.1.32"
|
||||
|
||||
# Substrate
|
||||
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
@@ -29,7 +29,7 @@ use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
|
||||
use cumulus_relay_chain_interface::RelayChainInterface;
|
||||
use polkadot_node_primitives::{CollationSecondedSignal, Statement};
|
||||
use polkadot_parachain::primitives::HeadData;
|
||||
use polkadot_primitives::v1::{
|
||||
use polkadot_primitives::v2::{
|
||||
CandidateReceipt, CompactStatement, Hash as PHash, Id as ParaId, OccupiedCoreAssumption,
|
||||
SigningContext, UncheckedSigned,
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@ use cumulus_test_service::runtime::{Block, Hash, Header};
|
||||
use futures::{executor::block_on, poll, task::Poll, FutureExt, Stream, StreamExt};
|
||||
use parking_lot::Mutex;
|
||||
use polkadot_node_primitives::{SignedFullStatement, Statement};
|
||||
use polkadot_primitives::v1::{
|
||||
use polkadot_primitives::v2::{
|
||||
CandidateCommitments, CandidateDescriptor, CollatorPair, CommittedCandidateReceipt,
|
||||
Hash as PHash, HeadData, Header as PHeader, Id as ParaId, InboundDownwardMessage,
|
||||
InboundHrmpMessage, OccupiedCoreAssumption, PersistedValidationData, SessionIndex,
|
||||
|
||||
@@ -10,7 +10,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "deriv
|
||||
futures = { version = "0.3.1", features = ["compat"] }
|
||||
futures-timer = "3.0.2"
|
||||
rand = "0.8.5"
|
||||
tracing = "0.1.31"
|
||||
tracing = "0.1.32"
|
||||
|
||||
# Substrate
|
||||
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
@@ -51,7 +51,7 @@ use sp_runtime::{
|
||||
|
||||
use polkadot_node_primitives::{AvailableData, POV_BOMB_LIMIT};
|
||||
use polkadot_overseer::Handle as OverseerHandle;
|
||||
use polkadot_primitives::v1::{
|
||||
use polkadot_primitives::v2::{
|
||||
CandidateReceipt, CommittedCandidateReceipt, Id as ParaId, SessionIndex,
|
||||
};
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ async-trait = "0.1.52"
|
||||
futures = "0.3.21"
|
||||
futures-timer = "3.0.2"
|
||||
parking_lot = "0.12.0"
|
||||
tracing = "0.1.31"
|
||||
tracing = "0.1.32"
|
||||
|
||||
# Substrate
|
||||
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
@@ -43,4 +43,4 @@ polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch =
|
||||
polkadot-test-client = { git = "https://github.com/paritytech/polkadot", branch = "master" }
|
||||
|
||||
# Cumulus
|
||||
cumulus-test-service = { path = "../../test/service" }
|
||||
cumulus-test-service = { path = "../../test/service" }
|
||||
|
||||
@@ -19,8 +19,10 @@ use std::{pin::Pin, sync::Arc, time::Duration};
|
||||
use async_trait::async_trait;
|
||||
use cumulus_primitives_core::{
|
||||
relay_chain::{
|
||||
v1::{CommittedCandidateReceipt, OccupiedCoreAssumption, SessionIndex, ValidatorId},
|
||||
v2::ParachainHost,
|
||||
v2::{
|
||||
CommittedCandidateReceipt, OccupiedCoreAssumption, ParachainHost, SessionIndex,
|
||||
ValidatorId,
|
||||
},
|
||||
Block as PBlock, BlockId, Hash as PHash, Header as PHeader, InboundHrmpMessage,
|
||||
},
|
||||
InboundDownwardMessage, ParaId, PersistedValidationData,
|
||||
@@ -384,7 +386,7 @@ mod tests {
|
||||
|
||||
use super::*;
|
||||
|
||||
use polkadot_primitives::v1::Block as PBlock;
|
||||
use polkadot_primitives::v2::Block as PBlock;
|
||||
use polkadot_test_client::{
|
||||
construct_transfer_extrinsic, BlockBuilderExt, Client, ClientBlockImportExt,
|
||||
DefaultTestClientBuilderExt, ExecutionStrategy, InitPolkadotBlockBuilder,
|
||||
|
||||
@@ -18,7 +18,7 @@ use std::{collections::BTreeMap, pin::Pin, sync::Arc};
|
||||
|
||||
use cumulus_primitives_core::{
|
||||
relay_chain::{
|
||||
v1::{CommittedCandidateReceipt, OccupiedCoreAssumption, SessionIndex, ValidatorId},
|
||||
v2::{CommittedCandidateReceipt, OccupiedCoreAssumption, SessionIndex, ValidatorId},
|
||||
Hash as PHash, Header as PHeader, InboundHrmpMessage,
|
||||
},
|
||||
InboundDownwardMessage, ParaId, PersistedValidationData,
|
||||
|
||||
@@ -24,7 +24,7 @@ futures-timer = "3.0.2"
|
||||
parity-scale-codec = "3.0.0"
|
||||
parking_lot = "0.12.0"
|
||||
jsonrpsee = { version = "0.9.0", features = ["client"] }
|
||||
tracing = "0.1.25"
|
||||
tracing = "0.1.32"
|
||||
async-trait = "0.1.52"
|
||||
url = "2.2.2"
|
||||
backoff = { version = "0.4.0", features = ["tokio"] }
|
||||
|
||||
@@ -19,7 +19,7 @@ use backoff::{future::retry_notify, ExponentialBackoff};
|
||||
use core::time::Duration;
|
||||
use cumulus_primitives_core::{
|
||||
relay_chain::{
|
||||
v1::{CommittedCandidateReceipt, OccupiedCoreAssumption, SessionIndex, ValidatorId},
|
||||
v2::{CommittedCandidateReceipt, OccupiedCoreAssumption, SessionIndex, ValidatorId},
|
||||
Hash as PHash, Header as PHeader, InboundHrmpMessage,
|
||||
},
|
||||
InboundDownwardMessage, ParaId, PersistedValidationData,
|
||||
|
||||
@@ -7,7 +7,7 @@ edition = "2021"
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0" }
|
||||
parking_lot = "0.12.0"
|
||||
tracing = "0.1.31"
|
||||
tracing = "0.1.32"
|
||||
|
||||
# Substrate
|
||||
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
@@ -22,7 +22,7 @@ use cumulus_client_cli::CollatorOptions;
|
||||
use cumulus_client_consensus_common::ParachainConsensus;
|
||||
use cumulus_primitives_core::{CollectCollationInfo, ParaId};
|
||||
use cumulus_relay_chain_interface::RelayChainInterface;
|
||||
use polkadot_primitives::v1::CollatorPair;
|
||||
use polkadot_primitives::v2::CollatorPair;
|
||||
use sc_client_api::{
|
||||
Backend as BackendT, BlockBackend, BlockchainEvents, Finalizer, UsageProvider,
|
||||
};
|
||||
|
||||
@@ -321,7 +321,7 @@ pub mod pallet {
|
||||
.read_upgrade_go_ahead_signal()
|
||||
.expect("Invalid upgrade go ahead signal");
|
||||
match upgrade_go_ahead_signal {
|
||||
Some(relay_chain::v1::UpgradeGoAhead::GoAhead) => {
|
||||
Some(relay_chain::v2::UpgradeGoAhead::GoAhead) => {
|
||||
assert!(
|
||||
<PendingValidationCode<T>>::exists(),
|
||||
"No new validation function found in storage, GoAhead signal is not expected",
|
||||
@@ -332,7 +332,7 @@ pub mod pallet {
|
||||
<T::OnSystemEvent as OnSystemEvent>::on_validation_code_applied();
|
||||
Self::deposit_event(Event::ValidationFunctionApplied(vfp.relay_parent_number));
|
||||
},
|
||||
Some(relay_chain::v1::UpgradeGoAhead::Abort) => {
|
||||
Some(relay_chain::v2::UpgradeGoAhead::Abort) => {
|
||||
<PendingValidationCode<T>>::kill();
|
||||
Self::deposit_event(Event::ValidationFunctionDiscarded);
|
||||
},
|
||||
@@ -482,7 +482,7 @@ pub mod pallet {
|
||||
/// set after the inherent.
|
||||
#[pallet::storage]
|
||||
pub(super) type UpgradeRestrictionSignal<T: Config> =
|
||||
StorageValue<_, Option<relay_chain::v1::UpgradeRestriction>, ValueQuery>;
|
||||
StorageValue<_, Option<relay_chain::v2::UpgradeRestriction>, ValueQuery>;
|
||||
|
||||
/// The snapshot of some state related to messaging relevant to the current parachain as per
|
||||
/// the relay parent.
|
||||
@@ -531,7 +531,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::v1::BlockNumber, ValueQuery>;
|
||||
StorageValue<_, relay_chain::v2::BlockNumber, ValueQuery>;
|
||||
|
||||
/// HRMP messages that were sent in a block.
|
||||
///
|
||||
@@ -779,7 +779,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::v1::BlockNumber,
|
||||
relay_parent_number: relay_chain::v2::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`.
|
||||
|
||||
@@ -145,7 +145,7 @@ impl RelayChainStateProof {
|
||||
/// `proof`.
|
||||
pub fn new(
|
||||
para_id: ParaId,
|
||||
relay_parent_storage_root: relay_chain::v1::Hash,
|
||||
relay_parent_storage_root: relay_chain::v2::Hash,
|
||||
proof: StorageProof,
|
||||
) -> Result<Self, Error> {
|
||||
let db = proof.into_memory_db::<HashFor<relay_chain::Block>>();
|
||||
@@ -191,7 +191,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::v1::HrmpChannelId { sender, recipient: self.para_id };
|
||||
let channel_id = relay_chain::v2::HrmpChannelId { sender, recipient: self.para_id };
|
||||
let hrmp_channel: AbridgedHrmpChannel = read_entry(
|
||||
&self.trie_backend,
|
||||
&relay_chain::well_known_keys::hrmp_channels(channel_id),
|
||||
@@ -203,7 +203,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::v1::HrmpChannelId { sender: self.para_id, recipient };
|
||||
let channel_id = relay_chain::v2::HrmpChannelId { sender: self.para_id, recipient };
|
||||
let hrmp_channel: AbridgedHrmpChannel = read_entry(
|
||||
&self.trie_backend,
|
||||
&relay_chain::well_known_keys::hrmp_channels(channel_id),
|
||||
@@ -231,12 +231,12 @@ impl RelayChainStateProof {
|
||||
.map_err(Error::Config)
|
||||
}
|
||||
|
||||
/// Read the [`Slot`](relay_chain::v1::Slot) from the relay chain state proof.
|
||||
/// Read the [`Slot`](relay_chain::v2::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::v1::Slot, Error> {
|
||||
pub fn read_slot(&self) -> Result<relay_chain::v2::Slot, Error> {
|
||||
read_entry(&self.trie_backend, relay_chain::well_known_keys::CURRENT_SLOT, None)
|
||||
.map_err(Error::Slot)
|
||||
}
|
||||
@@ -250,7 +250,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::v1::UpgradeGoAhead>, Error> {
|
||||
) -> Result<Option<relay_chain::v2::UpgradeGoAhead>, Error> {
|
||||
read_optional_entry(
|
||||
&self.trie_backend,
|
||||
&relay_chain::well_known_keys::upgrade_go_ahead_signal(self.para_id),
|
||||
@@ -266,7 +266,7 @@ impl RelayChainStateProof {
|
||||
/// Returns an error if anything failed at reading or decoding.
|
||||
pub fn read_upgrade_restriction_signal(
|
||||
&self,
|
||||
) -> Result<Option<relay_chain::v1::UpgradeRestriction>, Error> {
|
||||
) -> Result<Option<relay_chain::v2::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::v1::HrmpChannelId;
|
||||
use relay_chain::v2::HrmpChannelId;
|
||||
use sp_core::H256;
|
||||
use sp_runtime::{
|
||||
testing::Header,
|
||||
@@ -392,7 +392,7 @@ fn events() {
|
||||
BlockTests::new()
|
||||
.with_relay_sproof_builder(|_, block_number, builder| {
|
||||
if block_number > 123 {
|
||||
builder.upgrade_go_ahead = Some(relay_chain::v1::UpgradeGoAhead::GoAhead);
|
||||
builder.upgrade_go_ahead = Some(relay_chain::v2::UpgradeGoAhead::GoAhead);
|
||||
}
|
||||
})
|
||||
.add_with_post_test(
|
||||
@@ -443,7 +443,7 @@ fn manipulates_storage() {
|
||||
BlockTests::new()
|
||||
.with_relay_sproof_builder(|_, block_number, builder| {
|
||||
if block_number > 123 {
|
||||
builder.upgrade_go_ahead = Some(relay_chain::v1::UpgradeGoAhead::GoAhead);
|
||||
builder.upgrade_go_ahead = Some(relay_chain::v2::UpgradeGoAhead::GoAhead);
|
||||
}
|
||||
})
|
||||
.add(123, || {
|
||||
@@ -471,7 +471,7 @@ fn aborted_upgrade() {
|
||||
BlockTests::new()
|
||||
.with_relay_sproof_builder(|_, block_number, builder| {
|
||||
if block_number > 123 {
|
||||
builder.upgrade_go_ahead = Some(relay_chain::v1::UpgradeGoAhead::Abort);
|
||||
builder.upgrade_go_ahead = Some(relay_chain::v2::UpgradeGoAhead::Abort);
|
||||
}
|
||||
})
|
||||
.add(123, || {
|
||||
|
||||
@@ -21,7 +21,7 @@ use cumulus_pallet_parachain_system as parachain_system;
|
||||
use frame_support::{dispatch::DispatchResult, pallet_prelude::*, weights::DispatchInfo};
|
||||
use frame_system::pallet_prelude::*;
|
||||
pub use pallet::*;
|
||||
use polkadot_primitives::v1::PersistedValidationData;
|
||||
use polkadot_primitives::v2::PersistedValidationData;
|
||||
use scale_info::TypeInfo;
|
||||
use sp_runtime::{
|
||||
traits::{DispatchInfoOf, Dispatchable, SignedExtension},
|
||||
|
||||
@@ -56,6 +56,6 @@ std = [
|
||||
|
||||
runtime-benchmarks = [
|
||||
"frame-benchmarking/runtime-benchmarks",
|
||||
"frame-support/runtime-benchmarks",
|
||||
"frame-support/runtime-benchmarks",
|
||||
"frame-system/runtime-benchmarks",
|
||||
]
|
||||
|
||||
@@ -90,4 +90,4 @@ runtime-benchmarks = [
|
||||
"parachain-template-runtime/runtime-benchmarks",
|
||||
"polkadot-cli/runtime-benchmarks",
|
||||
]
|
||||
try-runtime = ["parachain-template-runtime/try-runtime"]
|
||||
try-runtime = ["parachain-template-runtime/try-runtime"]
|
||||
|
||||
@@ -275,7 +275,7 @@ pub fn run() -> Result<()> {
|
||||
let id = ParaId::from(para_id);
|
||||
|
||||
let parachain_account =
|
||||
AccountIdConversion::<polkadot_primitives::v0::AccountId>::into_account(&id);
|
||||
AccountIdConversion::<polkadot_primitives::v2::AccountId>::into_account(&id);
|
||||
|
||||
let state_version =
|
||||
RelayChainCli::native_runtime_version(&config.chain_spec).state_version();
|
||||
|
||||
@@ -40,7 +40,7 @@ impl<R> OnUnbalanced<NegativeImbalance<R>> for ToStakingPot<R>
|
||||
where
|
||||
R: pallet_balances::Config + pallet_collator_selection::Config,
|
||||
AccountIdOf<R>:
|
||||
From<polkadot_primitives::v1::AccountId> + Into<polkadot_primitives::v1::AccountId>,
|
||||
From<polkadot_primitives::v2::AccountId> + Into<polkadot_primitives::v2::AccountId>,
|
||||
<R as frame_system::Config>::Event: From<pallet_balances::Event<R>>,
|
||||
{
|
||||
fn on_nonzero_unbalanced(amount: NegativeImbalance<R>) {
|
||||
@@ -56,7 +56,7 @@ impl<R> OnUnbalanced<NegativeImbalance<R>> for DealWithFees<R>
|
||||
where
|
||||
R: pallet_balances::Config + pallet_collator_selection::Config,
|
||||
AccountIdOf<R>:
|
||||
From<polkadot_primitives::v1::AccountId> + Into<polkadot_primitives::v1::AccountId>,
|
||||
From<polkadot_primitives::v2::AccountId> + Into<polkadot_primitives::v2::AccountId>,
|
||||
<R as frame_system::Config>::Event: From<pallet_balances::Event<R>>,
|
||||
{
|
||||
fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item = NegativeImbalance<R>>) {
|
||||
@@ -76,7 +76,7 @@ impl<R> HandleCredit<AccountIdOf<R>, pallet_assets::Pallet<R>> for AssetsToBlock
|
||||
where
|
||||
R: pallet_authorship::Config + pallet_assets::Config,
|
||||
AccountIdOf<R>:
|
||||
From<polkadot_primitives::v1::AccountId> + Into<polkadot_primitives::v1::AccountId>,
|
||||
From<polkadot_primitives::v2::AccountId> + Into<polkadot_primitives::v2::AccountId>,
|
||||
{
|
||||
fn handle_credit(credit: CreditOf<AccountIdOf<R>, pallet_assets::Pallet<R>>) {
|
||||
if let Some(author) = pallet_authorship::Pallet::<R>::author() {
|
||||
@@ -119,7 +119,7 @@ mod tests {
|
||||
};
|
||||
use frame_system::{limits, EnsureRoot};
|
||||
use pallet_collator_selection::IdentityCollator;
|
||||
use polkadot_primitives::v1::AccountId;
|
||||
use polkadot_primitives::v2::AccountId;
|
||||
use sp_core::H256;
|
||||
use sp_runtime::{
|
||||
testing::Header,
|
||||
|
||||
@@ -508,7 +508,7 @@ pub fn run() -> Result<()> {
|
||||
let id = ParaId::from(para_id);
|
||||
|
||||
let parachain_account =
|
||||
AccountIdConversion::<polkadot_primitives::v0::AccountId>::into_account(&id);
|
||||
AccountIdConversion::<polkadot_primitives::v2::AccountId>::into_account(&id);
|
||||
|
||||
let state_version =
|
||||
RelayChainCli::native_runtime_version(&config.chain_spec).state_version();
|
||||
|
||||
@@ -25,7 +25,7 @@ use cumulus_client_service::{
|
||||
prepare_node_config, start_collator, start_full_node, StartCollatorParams, StartFullNodeParams,
|
||||
};
|
||||
use cumulus_primitives_core::{
|
||||
relay_chain::v1::{Hash as PHash, PersistedValidationData},
|
||||
relay_chain::v2::{Hash as PHash, PersistedValidationData},
|
||||
ParaId,
|
||||
};
|
||||
use cumulus_relay_chain_inprocess_interface::build_inprocess_relay_chain;
|
||||
|
||||
@@ -28,21 +28,21 @@ pub use polkadot_parachain::primitives::{
|
||||
DmpMessageHandler, Id as ParaId, IsSystem, UpwardMessage, ValidationParams, XcmpMessageFormat,
|
||||
XcmpMessageHandler,
|
||||
};
|
||||
pub use polkadot_primitives::v1::{
|
||||
pub use polkadot_primitives::v2::{
|
||||
AbridgedHostConfiguration, AbridgedHrmpChannel, PersistedValidationData,
|
||||
};
|
||||
|
||||
/// A module that re-exports relevant relay chain definitions.
|
||||
pub mod relay_chain {
|
||||
pub use polkadot_core_primitives::*;
|
||||
pub use polkadot_primitives::{v1, v1::well_known_keys, v2};
|
||||
pub use polkadot_primitives::{v2, v2::well_known_keys};
|
||||
}
|
||||
|
||||
/// An inbound HRMP message.
|
||||
pub type InboundHrmpMessage = polkadot_primitives::v1::InboundHrmpMessage<relay_chain::BlockNumber>;
|
||||
pub type InboundHrmpMessage = polkadot_primitives::v2::InboundHrmpMessage<relay_chain::BlockNumber>;
|
||||
|
||||
/// And outbound HRMP message
|
||||
pub type OutboundHrmpMessage = polkadot_primitives::v1::OutboundHrmpMessage<ParaId>;
|
||||
pub type OutboundHrmpMessage = polkadot_primitives::v2::OutboundHrmpMessage<ParaId>;
|
||||
|
||||
/// Error description of a message send failure.
|
||||
#[derive(Eq, PartialEq, Copy, Clone, RuntimeDebug, Encode, Decode)]
|
||||
@@ -204,11 +204,11 @@ pub struct CollationInfoV1 {
|
||||
/// The horizontal messages sent by the parachain.
|
||||
pub horizontal_messages: Vec<OutboundHrmpMessage>,
|
||||
/// New validation code.
|
||||
pub new_validation_code: Option<relay_chain::v1::ValidationCode>,
|
||||
pub new_validation_code: Option<relay_chain::v2::ValidationCode>,
|
||||
/// The number of messages processed from the DMQ.
|
||||
pub processed_downward_messages: u32,
|
||||
/// The mark which specifies the block number up to which all inbound HRMP messages are processed.
|
||||
pub hrmp_watermark: relay_chain::v1::BlockNumber,
|
||||
pub hrmp_watermark: relay_chain::v2::BlockNumber,
|
||||
}
|
||||
|
||||
impl CollationInfoV1 {
|
||||
@@ -233,11 +233,11 @@ pub struct CollationInfo {
|
||||
/// The horizontal messages sent by the parachain.
|
||||
pub horizontal_messages: Vec<OutboundHrmpMessage>,
|
||||
/// New validation code.
|
||||
pub new_validation_code: Option<relay_chain::v1::ValidationCode>,
|
||||
pub new_validation_code: Option<relay_chain::v2::ValidationCode>,
|
||||
/// The number of messages processed from the DMQ.
|
||||
pub processed_downward_messages: u32,
|
||||
/// The mark which specifies the block number up to which all inbound HRMP messages are processed.
|
||||
pub hrmp_watermark: relay_chain::v1::BlockNumber,
|
||||
pub hrmp_watermark: relay_chain::v2::BlockNumber,
|
||||
/// The head data, aka encoded header, of the block that corresponds to the collation.
|
||||
pub head_data: HeadData,
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ edition = "2021"
|
||||
async-trait = { version = "0.1.42", optional = true }
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive" ] }
|
||||
scale-info = { version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
tracing = { version = "0.1.31", optional = true }
|
||||
tracing = { version = "0.1.32", optional = true }
|
||||
|
||||
# Substrate
|
||||
sc-client-api = { git = "https://github.com/paritytech/substrate", optional = true, branch = "master" }
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
use crate::ParachainInherentData;
|
||||
use codec::Decode;
|
||||
use cumulus_primitives_core::{
|
||||
relay_chain::{self, v1::HrmpChannelId, Hash as PHash},
|
||||
relay_chain::{self, v2::HrmpChannelId, Hash as PHash},
|
||||
ParaId, PersistedValidationData,
|
||||
};
|
||||
use cumulus_relay_chain_interface::RelayChainInterface;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use cumulus_primitives_core::relay_chain::v1::Slot;
|
||||
use cumulus_primitives_core::relay_chain::v2::Slot;
|
||||
use sp_inherents::{Error, InherentData};
|
||||
use sp_std::time::Duration;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ use cumulus_primitives_core::{ParachainBlockData, PersistedValidationData};
|
||||
use cumulus_primitives_parachain_inherent::{ParachainInherentData, INHERENT_IDENTIFIER};
|
||||
use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder;
|
||||
use cumulus_test_runtime::{Block, GetLastTimestamp, Hash, Header};
|
||||
use polkadot_primitives::v1::{BlockNumber as PBlockNumber, Hash as PHash};
|
||||
use polkadot_primitives::v2::{BlockNumber as PBlockNumber, Hash as PHash};
|
||||
use sc_block_builder::{BlockBuilder, BlockBuilderProvider};
|
||||
use sp_api::ProvideRuntimeApi;
|
||||
use sp_runtime::{
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
use cumulus_primitives_core::{
|
||||
relay_chain, AbridgedHostConfiguration, AbridgedHrmpChannel, ParaId,
|
||||
};
|
||||
use polkadot_primitives::v1::UpgradeGoAhead;
|
||||
use polkadot_primitives::v2::UpgradeGoAhead;
|
||||
use sp_runtime::traits::HashFor;
|
||||
use sp_state_machine::MemoryDB;
|
||||
use sp_std::collections::btree_map::BTreeMap;
|
||||
@@ -41,8 +41,8 @@ pub struct RelayStateSproofBuilder {
|
||||
pub relay_dispatch_queue_size: Option<(u32, u32)>,
|
||||
pub hrmp_ingress_channel_index: Option<Vec<ParaId>>,
|
||||
pub hrmp_egress_channel_index: Option<Vec<ParaId>>,
|
||||
pub hrmp_channels: BTreeMap<relay_chain::v1::HrmpChannelId, AbridgedHrmpChannel>,
|
||||
pub current_slot: relay_chain::v1::Slot,
|
||||
pub hrmp_channels: BTreeMap<relay_chain::v2::HrmpChannelId, AbridgedHrmpChannel>,
|
||||
pub current_slot: relay_chain::v2::Slot,
|
||||
}
|
||||
|
||||
impl Default for RelayStateSproofBuilder {
|
||||
@@ -84,7 +84,7 @@ impl RelayStateSproofBuilder {
|
||||
}
|
||||
|
||||
self.hrmp_channels
|
||||
.entry(relay_chain::v1::HrmpChannelId { sender, recipient: self.para_id })
|
||||
.entry(relay_chain::v2::HrmpChannelId { sender, recipient: self.para_id })
|
||||
.or_insert_with(|| AbridgedHrmpChannel {
|
||||
max_capacity: 0,
|
||||
max_total_size: 0,
|
||||
@@ -97,8 +97,8 @@ impl RelayStateSproofBuilder {
|
||||
|
||||
pub fn into_state_root_and_proof(
|
||||
self,
|
||||
) -> (polkadot_primitives::v1::Hash, sp_state_machine::StorageProof) {
|
||||
let (db, root) = MemoryDB::<HashFor<polkadot_primitives::v1::Block>>::default_with_root();
|
||||
) -> (polkadot_primitives::v2::Hash, sp_state_machine::StorageProof) {
|
||||
let (db, root) = MemoryDB::<HashFor<polkadot_primitives::v2::Block>>::default_with_root();
|
||||
let state_version = Default::default(); // for test using default.
|
||||
let mut backend = sp_state_machine::TrieBackend::new(db, root);
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ use codec::Encode;
|
||||
use cumulus_client_service::genesis::generate_genesis_block;
|
||||
use cumulus_primitives_core::ParaId;
|
||||
use cumulus_test_runtime::Block;
|
||||
use polkadot_primitives::v0::HeadData;
|
||||
use polkadot_primitives::v2::HeadData;
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
|
||||
/// Returns the initial head data for a parachain ID.
|
||||
|
||||
@@ -42,7 +42,7 @@ use cumulus_test_runtime::{Hash, Header, NodeBlock as Block, RuntimeApi};
|
||||
use parking_lot::Mutex;
|
||||
|
||||
use frame_system_rpc_runtime_api::AccountNonceApi;
|
||||
use polkadot_primitives::v1::{CollatorPair, Hash as PHash, PersistedValidationData};
|
||||
use polkadot_primitives::v2::{CollatorPair, Hash as PHash, PersistedValidationData};
|
||||
use polkadot_service::ProvideRuntimeApi;
|
||||
use sc_client_api::execution_extensions::ExecutionStrategies;
|
||||
use sc_network::{config::TransportConfig, multiaddr, NetworkService};
|
||||
|
||||
Reference in New Issue
Block a user