Ensure transactional with ? works in frame v2 (#7982)

This commit is contained in:
Guillaume Thiolliere
2021-01-26 16:42:27 +01:00
committed by GitHub
parent e535e4211e
commit 4e1f112059
2 changed files with 6 additions and 5 deletions
+4 -4
View File
@@ -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::<T>::InsufficientProposersBalance.into())
if foo == 0 {
Err(Error::<T>::InsufficientProposersBalance)?;
}
Ok(().into())
}
}