mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-19 13:25:44 +00:00
IntegrityTest implementation should be feature gated (#13094)
* `IntegrityTest` implementation should be feature gated The initial implementation for the old declarative macros is still feature gating the implementation. As we only call this in a test, there is no need to have this compiled for wasm. * Don't assume that all "consumers" have a `std` feature
This commit is contained in:
@@ -191,16 +191,19 @@ pub fn expand_hooks(def: &mut Def) -> proc_macro2::TokenStream {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<#type_impl_gen>
|
// Integrity tests are only required for when `std` is enabled.
|
||||||
#frame_support::traits::IntegrityTest
|
#frame_support::std_enabled! {
|
||||||
|
impl<#type_impl_gen>
|
||||||
|
#frame_support::traits::IntegrityTest
|
||||||
for #pallet_ident<#type_use_gen> #where_clause
|
for #pallet_ident<#type_use_gen> #where_clause
|
||||||
{
|
{
|
||||||
fn integrity_test() {
|
fn integrity_test() {
|
||||||
<
|
<
|
||||||
Self as #frame_support::traits::Hooks<
|
Self as #frame_support::traits::Hooks<
|
||||||
<T as #frame_system::Config>::BlockNumber
|
<T as #frame_system::Config>::BlockNumber
|
||||||
>
|
>
|
||||||
>::integrity_test()
|
>::integrity_test()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2744,3 +2744,6 @@ pub mod pallet_macros {
|
|||||||
type_value, unbounded, validate_unsigned, weight, whitelist_storage,
|
type_value, unbounded, validate_unsigned, weight, whitelist_storage,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Generate a macro that will enable/disable code based on `std` feature being active.
|
||||||
|
sp_core::generate_feature_enabled_macro!(std_enabled, feature = "std", $);
|
||||||
|
|||||||
@@ -16,10 +16,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
||||||
use frame_support::{
|
use frame_support::traits::{ConstU32, ConstU64};
|
||||||
traits::{ConstU32, ConstU64},
|
|
||||||
weights::Weight,
|
|
||||||
};
|
|
||||||
use sp_core::H256;
|
use sp_core::H256;
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
testing::Header,
|
testing::Header,
|
||||||
|
|||||||
Reference in New Issue
Block a user