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

Commit

Permalink
Do not run pallet_ui test with conditional-storage feature (#9122)
Browse files Browse the repository at this point in the history
* do not run pallet_ui test with conditional-compilation feature

* fix
  • Loading branch information
gui1117 authored Jun 16, 2021
1 parent f88f4ed commit c3e9fcf
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
1 change: 1 addition & 0 deletions frame/support/test/tests/pallet_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// limitations under the License.

#[rustversion::attr(not(stable), ignore)]
#[cfg(not(feature = "conditional-storage"))]
#[test]
fn pallet_ui() {
// As trybuild is using `cargo check`, we don't need the real WASM binaries.
Expand Down
37 changes: 18 additions & 19 deletions frame/support/test/tests/pallet_ui/storage_info_unsatisfied_nmap.rs
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
// #[frame_support::pallet]
// mod pallet {
// use frame_support::pallet_prelude::{Hooks, StorageNMap, Twox64Concat, NMapKey};
// use frame_system::pallet_prelude::BlockNumberFor;
#[frame_support::pallet]
mod pallet {
use frame_support::pallet_prelude::{Hooks, StorageNMap, Twox64Concat, NMapKey};
use frame_system::pallet_prelude::BlockNumberFor;

// #[pallet::config]
// pub trait Config: frame_system::Config {}
#[pallet::config]
pub trait Config: frame_system::Config {}

// #[pallet::pallet]
// #[pallet::generate_storage_info]
// pub struct Pallet<T>(core::marker::PhantomData<T>);
#[pallet::pallet]
#[pallet::generate_storage_info]
pub struct Pallet<T>(core::marker::PhantomData<T>);

// #[pallet::hooks]
// impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}

// #[pallet::call]
// impl<T: Config> Pallet<T> {}
#[pallet::call]
impl<T: Config> Pallet<T> {}

// #[derive(codec::Encode, codec::Decode)]
// struct Bar;
#[derive(codec::Encode, codec::Decode)]
struct Bar;

// #[pallet::storage]
// type Foo<T> = StorageNMap<_, NMapKey<Twox64Concat, Bar>, u32>;
// }
#[pallet::storage]
type Foo<T> = StorageNMap<_, NMapKey<Twox64Concat, Bar>, u32>;
}

fn main() {
compile_error!("Temporarily disabled due to test flakiness");
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
error: Temporarily disabled due to test flakiness
--> $DIR/storage_info_unsatisfied_nmap.rs:27:2
error[E0277]: the trait bound `Bar: MaxEncodedLen` is not satisfied
--> $DIR/storage_info_unsatisfied_nmap.rs:10:12
|
27 | compile_error!("Temporarily disabled due to test flakiness");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10 | #[pallet::generate_storage_info]
| ^^^^^^^^^^^^^^^^^^^^^ the trait `MaxEncodedLen` is not implemented for `Bar`
|
= note: required because of the requirements on the impl of `KeyGeneratorMaxEncodedLen` for `NMapKey<frame_support::Twox64Concat, Bar>`
= note: required because of the requirements on the impl of `StorageInfoTrait` for `frame_support::pallet_prelude::StorageNMap<_GeneratedPrefixForStorageFoo<T>, NMapKey<frame_support::Twox64Concat, Bar>, u32>`
= note: required by `storage_info`

0 comments on commit c3e9fcf

Please sign in to comment.