From 4c0b765980151ac040f24940e3daf25ef52e1351 Mon Sep 17 00:00:00 2001 From: lumir-mrkva <lumir.mrkva@topmonks.com> Date: Sun, 17 Jul 2022 21:28:32 +0200 Subject: [PATCH] assert noop notifies that storage has been mutated (#11805) --- substrate/frame/support/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/substrate/frame/support/src/lib.rs b/substrate/frame/support/src/lib.rs index f2cd7d1e165..8e43df82a28 100644 --- a/substrate/frame/support/src/lib.rs +++ b/substrate/frame/support/src/lib.rs @@ -679,7 +679,7 @@ macro_rules! assert_noop { ) => { let h = $crate::storage_root($crate::StateVersion::V1); $crate::assert_err!($x, $y); - assert_eq!(h, $crate::storage_root($crate::StateVersion::V1)); + assert_eq!(h, $crate::storage_root($crate::StateVersion::V1), "storage has been mutated"); }; } @@ -826,6 +826,7 @@ pub mod tests { pub struct Module<T: Config> for enum Call where origin: T::Origin, system=self {} } } + use self::module::Module; decl_storage! { @@ -851,6 +852,7 @@ pub mod tests { } struct Test; + impl Config for Test { type BlockNumber = u32; type Origin = u32; @@ -867,6 +869,7 @@ pub mod tests { trait Sorted { fn sorted(self) -> Self; } + impl<T: Ord> Sorted for Vec<T> { fn sorted(mut self) -> Self { self.sort(); -- GitLab