Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez committed Dec 22, 2022
1 parent 2e96402 commit 3991122
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 0 deletions.
18 changes: 18 additions & 0 deletions frame/support/test/tests/pallet_ui/storage_invalid_pov_estimate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#[frame_support::pallet]
mod pallet {
use frame_support::pallet_prelude::Hooks;
use frame_system::pallet_prelude::BlockNumberFor;

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

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

#[pallet::storage]
#[pallet::pov_estimate = Wrong]
type Foo<T> = StorageValue<_, u8>;
}

fn main() {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
error: Invalid value for the proof_size attribute: Error("expected `MaxEncodedLen` or `Measured`")
--> tests/pallet_ui/storage_invalid_pov_estimate.rs:13:3
|
13 | #[pallet::pov_estimate = Wrong]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#[frame_support::pallet]
mod pallet {
use frame_support::pallet_prelude::*;

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

#[pallet::pallet]
pub struct Pallet<T>(_);

#[pallet::error]
pub enum Error<T> {}

#[pallet::storage]
#[pallet::pov_estimate = MaxEncodedLen]
#[pallet::pov_estimate = MaxEncodedLen]
type Foo<T: Config> = StorageValue<_, u8>;
}

fn main() {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
error: Invalid attribute: Duplicate attribute
--> tests/pallet_ui/storage_multiple_pov_estimate.rs:16:3
|
16 | #[pallet::pov_estimate = MaxEncodedLen]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#[frame_support::pallet]
mod pallet {
use frame_support::pallet_prelude::*;

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

#[pallet::pallet]
#[pallet::pov_estimate = MaxEncodedLen]
pub struct Pallet<T>(_);

#[pallet::error]
pub enum Error<T> {}

#[pallet::storage]
type Foo<T: Config> = StorageValue<_, u8>;
}

fn main() {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
error: expected one of: `generate_store`, `without_storage_info`, `storage_version`
--> tests/pallet_ui/storage_pov_estimate_on_pallet.rs:9:12
|
9 | #[pallet::pov_estimate = MaxEncodedLen]
| ^^^^^^^^^^^^

0 comments on commit 3991122

Please sign in to comment.