mirror of
https://github.com/pezkuwichain/pezkuwi-runtime-templates.git
synced 2026-06-13 00:01:02 +00:00
Fix tanssi on main (#393)
* fix the tanssi build & tests * fix fmt * update features for coverage * cleanup on coverage due runner out of space * a bit more tests to pass the codecov check * fix fmt
This commit is contained in:
@@ -189,6 +189,11 @@ impl AssetsConfig for OpenZeppelinRuntime {
|
||||
type ForeignAssetModifierOrigin = EnsureRoot<AccountId>;
|
||||
type WeightToFee = WeightToFee;
|
||||
}
|
||||
#[cfg(feature = "tanssi")]
|
||||
impl TanssiConfig for OpenZeppelinRuntime {
|
||||
type AuthorInherent = pallet_author_inherent::weights::SubstrateWeight<Runtime>;
|
||||
type AuthoritiesNothing = pallet_cc_authorities_noting::weights::SubstrateWeight<Runtime>;
|
||||
}
|
||||
impl_openzeppelin_system!(OpenZeppelinRuntime);
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
impl_openzeppelin_consensus!(OpenZeppelinRuntime);
|
||||
@@ -197,4 +202,4 @@ impl_openzeppelin_xcm!(OpenZeppelinRuntime);
|
||||
impl_openzeppelin_assets!(OpenZeppelinRuntime);
|
||||
|
||||
#[cfg(feature = "tanssi")]
|
||||
impl_openzeppelin_tanssi!();
|
||||
impl_openzeppelin_tanssi!(OpenZeppelinRuntime);
|
||||
|
||||
@@ -207,6 +207,7 @@ mod test {
|
||||
use crate::{types::ProxyType, AssetManager, RuntimeCall};
|
||||
|
||||
#[test]
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
fn test_filter_any() {
|
||||
let call = RuntimeCall::CollatorSelection(
|
||||
pallet_collator_selection::Call::set_desired_candidates { max: 10 },
|
||||
@@ -216,6 +217,7 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
fn test_filter_nontransfer() {
|
||||
let proxy_type = ProxyType::NonTransfer;
|
||||
let valid_call = RuntimeCall::CollatorSelection(
|
||||
@@ -228,6 +230,7 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
fn test_filter_cancel_proxy() {
|
||||
let proxy_type = ProxyType::CancelProxy;
|
||||
let invalid_call = RuntimeCall::CollatorSelection(
|
||||
@@ -242,6 +245,7 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
fn test_filter_collator() {
|
||||
let proxy_type = ProxyType::Collator;
|
||||
let valid_call = RuntimeCall::CollatorSelection(
|
||||
|
||||
@@ -204,6 +204,7 @@ mod runtime_tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
fn session_constants() {
|
||||
assert_eq!(configs::Period::get(), 6 * HOURS);
|
||||
|
||||
@@ -212,6 +213,7 @@ mod runtime_tests {
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::assertions_on_constants)]
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
fn aura_constants() {
|
||||
#[cfg(not(feature = "async-backing"))]
|
||||
assert!(!<Runtime as pallet_aura::Config>::AllowMultipleBlocksPerSlot::get());
|
||||
@@ -222,6 +224,7 @@ mod runtime_tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
fn collator_selection_constants() {
|
||||
let pallet_id_to_string = |id: PalletId| -> String {
|
||||
core::str::from_utf8(&id.0).unwrap_or_default().to_string()
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// Storage indices integration checks
|
||||
use frame_support::traits::PalletInfo;
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
use generic_runtime_template::{Aura, AuraExt, Authorship, CollatorSelection, Session};
|
||||
use generic_runtime_template::{
|
||||
Aura, AuraExt, Authorship, Balances, CollatorSelection, CumulusXcm, MessageQueue, Multisig,
|
||||
ParachainInfo, ParachainSystem, PolkadotXcm, Proxy, Runtime, Session, Sudo, System, Timestamp,
|
||||
TransactionPayment, XcmpQueue,
|
||||
Balances, CumulusXcm, MessageQueue, Multisig, ParachainInfo, ParachainSystem, PolkadotXcm,
|
||||
Proxy, Runtime, Sudo, System, Timestamp, TransactionPayment, XcmpQueue,
|
||||
};
|
||||
|
||||
fn assert_pallet_prefix<P: 'static>(name: &str) {
|
||||
@@ -21,13 +22,17 @@ fn verify_pallet_prefixes() {
|
||||
assert_pallet_prefix::<TransactionPayment>("TransactionPayment");
|
||||
assert_pallet_prefix::<Sudo>("Sudo");
|
||||
assert_pallet_prefix::<Multisig>("Multisig");
|
||||
assert_pallet_prefix::<Authorship>("Authorship");
|
||||
assert_pallet_prefix::<CollatorSelection>("CollatorSelection");
|
||||
assert_pallet_prefix::<Session>("Session");
|
||||
assert_pallet_prefix::<Aura>("Aura");
|
||||
assert_pallet_prefix::<AuraExt>("AuraExt");
|
||||
assert_pallet_prefix::<XcmpQueue>("XcmpQueue");
|
||||
assert_pallet_prefix::<PolkadotXcm>("PolkadotXcm");
|
||||
assert_pallet_prefix::<CumulusXcm>("CumulusXcm");
|
||||
assert_pallet_prefix::<MessageQueue>("MessageQueue");
|
||||
|
||||
#[cfg(not(feature = "tanssi"))]
|
||||
{
|
||||
assert_pallet_prefix::<Authorship>("Authorship");
|
||||
assert_pallet_prefix::<Aura>("Aura");
|
||||
assert_pallet_prefix::<AuraExt>("AuraExt");
|
||||
assert_pallet_prefix::<CollatorSelection>("CollatorSelection");
|
||||
assert_pallet_prefix::<Session>("Session");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user