Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Companion for Substrate#14373 #7562

Closed
2,492 changes: 1,256 additions & 1,236 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

//! Polkadot chain configurations.

use beefy_primitives::crypto::AuthorityId as BeefyId;
use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId;
use grandpa::AuthorityId as GrandpaId;
#[cfg(feature = "kusama-native")]
use kusama_runtime as kusama;
Expand Down
4 changes: 2 additions & 2 deletions node/service/src/fake_runtime_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//!
//! These are used to provide a type that implements these runtime APIs without requiring to import the native runtimes.

use beefy_primitives::crypto::{AuthorityId as BeefyId, Signature as BeefySignature};
use beefy_primitives::ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature};
use grandpa_primitives::AuthorityId as GrandpaId;
use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo};
use polkadot_primitives::{
Expand Down Expand Up @@ -230,7 +230,7 @@ sp_api::impl_runtime_apis! {
}
}

impl beefy_primitives::BeefyApi<Block> for Runtime {
impl beefy_primitives::BeefyApi<Block, BeefyId> for Runtime {
fn beefy_genesis() -> Option<BlockNumber> {
unimplemented!()
}
Expand Down
4 changes: 2 additions & 2 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ use runtime_parachains::{
};

use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
use beefy_primitives::crypto::{AuthorityId as BeefyId, Signature as BeefySignature};
use beefy_primitives::ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature};
use frame_election_provider_support::{
generate_solution_type, onchain, NposSolution, SequentialPhragmen,
};
Expand Down Expand Up @@ -1816,7 +1816,7 @@ sp_api::impl_runtime_apis! {
}
}

impl beefy_primitives::BeefyApi<Block> for Runtime {
impl beefy_primitives::BeefyApi<Block, BeefyId> for Runtime {
fn beefy_genesis() -> Option<BlockNumber> {
// dummy implementation due to lack of BEEFY pallet.
None
Expand Down
13 changes: 8 additions & 5 deletions runtime/kusama/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,10 @@ fn karura_liquid_staking_xcm_has_sane_weight_upper_limt() {

// should be [WithdrawAsset, BuyExecution, Transact, RefundSurplus, DepositAsset]
let blob = hex_literal::hex!("02140004000000000700e40b540213000000000700e40b54020006010700c817a804341801000006010b00c490bf4302140d010003ffffffff000100411f");
let Ok(VersionedXcm::V2(old_xcm)) =
VersionedXcm::<super::RuntimeCall>::decode(&mut &blob[..]) else { panic!("can't decode XCM blob") };
let Ok(VersionedXcm::V2(old_xcm)) = VersionedXcm::<super::RuntimeCall>::decode(&mut &blob[..])
else {
panic!("can't decode XCM blob")
};
let mut xcm: Xcm<super::RuntimeCall> =
old_xcm.try_into().expect("conversion from v2 to v3 failed");
let weight = <XcmConfig as xcm_executor::Config>::Weigher::weight(&mut xcm)
Expand All @@ -444,9 +446,10 @@ fn karura_liquid_staking_xcm_has_sane_weight_upper_limt() {
assert!(weight.all_lte(Weight::from_parts(30_313_281_000, 72_722)));

let Some(Transact { require_weight_at_most, call, .. }) =
xcm.inner_mut().into_iter().find(|inst| matches!(inst, Transact { .. })) else {
panic!("no Transact instruction found")
};
xcm.inner_mut().into_iter().find(|inst| matches!(inst, Transact { .. }))
else {
panic!("no Transact instruction found")
};
// should be pallet_utility.as_derivative { index: 0, call: pallet_staking::bond_extra { max_additional: 2490000000000 } }
let message_call = call.take_decoded().expect("can't decode Transact call");
let call_weight = message_call.get_dispatch_info().weight;
Expand Down
4 changes: 2 additions & 2 deletions runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use runtime_parachains::{
};

use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
use beefy_primitives::crypto::{AuthorityId as BeefyId, Signature as BeefySignature};
use beefy_primitives::ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature};
use frame_election_provider_support::{generate_solution_type, onchain, SequentialPhragmen};
use frame_support::{
construct_runtime, parameter_types,
Expand Down Expand Up @@ -1819,7 +1819,7 @@ sp_api::impl_runtime_apis! {
}
}

impl beefy_primitives::BeefyApi<Block> for Runtime {
impl beefy_primitives::BeefyApi<Block, BeefyId> for Runtime {
fn beefy_genesis() -> Option<BlockNumber> {
// dummy implementation due to lack of BEEFY pallet.
None
Expand Down
6 changes: 3 additions & 3 deletions runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ use runtime_parachains::{

use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
use beefy_primitives::{
crypto::{AuthorityId as BeefyId, Signature as BeefySignature},
ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature},
mmr::{BeefyDataProvider, MmrLeafVersion},
};

Expand Down Expand Up @@ -1819,8 +1819,8 @@ sp_api::impl_runtime_apis! {
}
}

#[api_version(2)]
impl beefy_primitives::BeefyApi<Block> for Runtime {
#[api_version(3)]
impl beefy_primitives::BeefyApi<Block, BeefyId> for Runtime {
fn beefy_genesis() -> Option<BlockNumber> {
Beefy::genesis_block()
}
Expand Down
4 changes: 2 additions & 2 deletions runtime/test-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use polkadot_runtime_parachains::{
};

use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
use beefy_primitives::crypto::{AuthorityId as BeefyId, Signature as BeefySignature};
use beefy_primitives::ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature};
use frame_election_provider_support::{onchain, SequentialPhragmen};
use frame_support::{
construct_runtime, parameter_types,
Expand Down Expand Up @@ -939,7 +939,7 @@ sp_api::impl_runtime_apis! {
}
}

impl beefy_primitives::BeefyApi<Block> for Runtime {
impl beefy_primitives::BeefyApi<Block, BeefyId> for Runtime {
fn beefy_genesis() -> Option<BlockNumber> {
// dummy implementation due to lack of BEEFY pallet.
None
Expand Down
4 changes: 2 additions & 2 deletions runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#![recursion_limit = "256"]

use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
use beefy_primitives::crypto::{AuthorityId as BeefyId, Signature as BeefySignature};
use beefy_primitives::ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature};
use frame_election_provider_support::{onchain, SequentialPhragmen};
use frame_support::{
construct_runtime, parameter_types,
Expand Down Expand Up @@ -1554,7 +1554,7 @@ sp_api::impl_runtime_apis! {
}
}

impl beefy_primitives::BeefyApi<Block> for Runtime {
impl beefy_primitives::BeefyApi<Block, BeefyId> for Runtime {
fn beefy_genesis() -> Option<BlockNumber> {
// dummy implementation due to lack of BEEFY pallet.
None
Expand Down