diff --git a/substrate/frame/support/test/tests/pallet.rs b/substrate/frame/support/test/tests/pallet.rs index 974b901480..431377a70e 100644 --- a/substrate/frame/support/test/tests/pallet.rs +++ b/substrate/frame/support/test/tests/pallet.rs @@ -155,11 +155,11 @@ pub mod pallet { #[pallet::compact] foo: u32, ) -> DispatchResultWithPostInfo { Self::deposit_event(Event::Something(0)); - if foo != 0 { - Ok(().into()) - } else { - Err(Error::::InsufficientProposersBalance.into()) + if foo == 0 { + Err(Error::::InsufficientProposersBalance)?; } + + Ok(().into()) } } diff --git a/substrate/frame/support/test/tests/storage_transaction.rs b/substrate/frame/support/test/tests/storage_transaction.rs index 0c3fa2ff36..ee6ce5869e 100644 --- a/substrate/frame/support/test/tests/storage_transaction.rs +++ b/substrate/frame/support/test/tests/storage_transaction.rs @@ -195,7 +195,8 @@ fn transactional_annotation() { #[transactional] fn value_rollbacks(v: u32) -> result::Result { set_value(v)?; - Err("nah") + Err("nah")?; + Ok(v) } TestExternalities::default().execute_with(|| {