Companion for Substrate#14373 (#7572)

* rename BEEFY `crypto` →`ecdsa_crypto`

* - bump up `BeefyApi` to version 3
- deal with `PeerId` error.

* update BEEFY dependency names for `fake-runtime` and `chain_spec`
revert Cargo.toml

* cargo fmt

* Use master Cargo.lock

* update lockfile for {"substrate"}

---------

Co-authored-by: Davide Galassi <davxy@datawok.net>
Co-authored-by: parity-processbot <>
This commit is contained in:
drskalman
2023-08-02 17:25:12 +02:00
committed by GitHub
parent 253c505edc
commit 2bbc7a73a3
9 changed files with 206 additions and 203 deletions
+184 -184
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -16,7 +16,7 @@
//! Polkadot chain configurations. //! Polkadot chain configurations.
use beefy_primitives::crypto::AuthorityId as BeefyId; use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId;
use grandpa::AuthorityId as GrandpaId; use grandpa::AuthorityId as GrandpaId;
#[cfg(feature = "kusama-native")] #[cfg(feature = "kusama-native")]
use kusama_runtime as kusama; use kusama_runtime as kusama;
@@ -18,7 +18,7 @@
//! //!
//! These are used to provide a type that implements these runtime APIs without requiring to import the native runtimes. //! 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 grandpa_primitives::AuthorityId as GrandpaId;
use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo};
use polkadot_primitives::{ use polkadot_primitives::{
@@ -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> { fn beefy_genesis() -> Option<BlockNumber> {
unimplemented!() unimplemented!()
} }
+2 -2
View File
@@ -51,7 +51,7 @@ use runtime_parachains::{
}; };
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; 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::{ use frame_election_provider_support::{
generate_solution_type, onchain, NposSolution, SequentialPhragmen, generate_solution_type, onchain, NposSolution, SequentialPhragmen,
}; };
@@ -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> { fn beefy_genesis() -> Option<BlockNumber> {
// dummy implementation due to lack of BEEFY pallet. // dummy implementation due to lack of BEEFY pallet.
None None
+6 -3
View File
@@ -432,8 +432,10 @@ fn karura_liquid_staking_xcm_has_sane_weight_upper_limt() {
// should be [WithdrawAsset, BuyExecution, Transact, RefundSurplus, DepositAsset] // should be [WithdrawAsset, BuyExecution, Transact, RefundSurplus, DepositAsset]
let blob = hex_literal::hex!("02140004000000000700e40b540213000000000700e40b54020006010700c817a804341801000006010b00c490bf4302140d010003ffffffff000100411f"); let blob = hex_literal::hex!("02140004000000000700e40b540213000000000700e40b54020006010700c817a804341801000006010b00c490bf4302140d010003ffffffff000100411f");
let Ok(VersionedXcm::V2(old_xcm)) = let Ok(VersionedXcm::V2(old_xcm)) = VersionedXcm::<super::RuntimeCall>::decode(&mut &blob[..])
VersionedXcm::<super::RuntimeCall>::decode(&mut &blob[..]) else { panic!("can't decode XCM blob") }; else {
panic!("can't decode XCM blob")
};
let mut xcm: Xcm<super::RuntimeCall> = let mut xcm: Xcm<super::RuntimeCall> =
old_xcm.try_into().expect("conversion from v2 to v3 failed"); old_xcm.try_into().expect("conversion from v2 to v3 failed");
let weight = <XcmConfig as xcm_executor::Config>::Weigher::weight(&mut xcm) let weight = <XcmConfig as xcm_executor::Config>::Weigher::weight(&mut xcm)
@@ -444,7 +446,8 @@ fn karura_liquid_staking_xcm_has_sane_weight_upper_limt() {
assert!(weight.all_lte(Weight::from_parts(30_313_281_000, 72_722))); assert!(weight.all_lte(Weight::from_parts(30_313_281_000, 72_722)));
let Some(Transact { require_weight_at_most, call, .. }) = let Some(Transact { require_weight_at_most, call, .. }) =
xcm.inner_mut().into_iter().find(|inst| matches!(inst, Transact { .. })) else { xcm.inner_mut().into_iter().find(|inst| matches!(inst, Transact { .. }))
else {
panic!("no Transact instruction found") panic!("no Transact instruction found")
}; };
// should be pallet_utility.as_derivative { index: 0, call: pallet_staking::bond_extra { max_additional: 2490000000000 } } // should be pallet_utility.as_derivative { index: 0, call: pallet_staking::bond_extra { max_additional: 2490000000000 } }
+2 -2
View File
@@ -39,7 +39,7 @@ use runtime_parachains::{
}; };
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; 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_election_provider_support::{generate_solution_type, onchain, SequentialPhragmen};
use frame_support::{ use frame_support::{
construct_runtime, parameter_types, construct_runtime, parameter_types,
@@ -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> { fn beefy_genesis() -> Option<BlockNumber> {
// dummy implementation due to lack of BEEFY pallet. // dummy implementation due to lack of BEEFY pallet.
None None
+3 -3
View File
@@ -51,7 +51,7 @@ use runtime_parachains::{
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
use beefy_primitives::{ use beefy_primitives::{
crypto::{AuthorityId as BeefyId, Signature as BeefySignature}, ecdsa_crypto::{AuthorityId as BeefyId, Signature as BeefySignature},
mmr::{BeefyDataProvider, MmrLeafVersion}, mmr::{BeefyDataProvider, MmrLeafVersion},
}; };
@@ -1819,8 +1819,8 @@ sp_api::impl_runtime_apis! {
} }
} }
#[api_version(2)] #[api_version(3)]
impl beefy_primitives::BeefyApi<Block> for Runtime { impl beefy_primitives::BeefyApi<Block, BeefyId> for Runtime {
fn beefy_genesis() -> Option<BlockNumber> { fn beefy_genesis() -> Option<BlockNumber> {
Beefy::genesis_block() Beefy::genesis_block()
} }
+2 -2
View File
@@ -35,7 +35,7 @@ use polkadot_runtime_parachains::{
}; };
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; 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_election_provider_support::{onchain, SequentialPhragmen};
use frame_support::{ use frame_support::{
construct_runtime, parameter_types, construct_runtime, parameter_types,
@@ -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> { fn beefy_genesis() -> Option<BlockNumber> {
// dummy implementation due to lack of BEEFY pallet. // dummy implementation due to lack of BEEFY pallet.
None None
+2 -2
View File
@@ -21,7 +21,7 @@
#![recursion_limit = "256"] #![recursion_limit = "256"]
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId; 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_election_provider_support::{onchain, SequentialPhragmen};
use frame_support::{ use frame_support::{
construct_runtime, parameter_types, construct_runtime, parameter_types,
@@ -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> { fn beefy_genesis() -> Option<BlockNumber> {
// dummy implementation due to lack of BEEFY pallet. // dummy implementation due to lack of BEEFY pallet.
None None