mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 13:31:10 +00:00
Ensure transactional with ? works in frame v2 (#7982)
This commit is contained in:
committed by
GitHub
parent
e535e4211e
commit
4e1f112059
@@ -155,11 +155,11 @@ pub mod pallet {
|
|||||||
#[pallet::compact] foo: u32,
|
#[pallet::compact] foo: u32,
|
||||||
) -> DispatchResultWithPostInfo {
|
) -> DispatchResultWithPostInfo {
|
||||||
Self::deposit_event(Event::Something(0));
|
Self::deposit_event(Event::Something(0));
|
||||||
if foo != 0 {
|
if foo == 0 {
|
||||||
Ok(().into())
|
Err(Error::<T>::InsufficientProposersBalance)?;
|
||||||
} else {
|
|
||||||
Err(Error::<T>::InsufficientProposersBalance.into())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ok(().into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,8 @@ fn transactional_annotation() {
|
|||||||
#[transactional]
|
#[transactional]
|
||||||
fn value_rollbacks(v: u32) -> result::Result<u32, &'static str> {
|
fn value_rollbacks(v: u32) -> result::Result<u32, &'static str> {
|
||||||
set_value(v)?;
|
set_value(v)?;
|
||||||
Err("nah")
|
Err("nah")?;
|
||||||
|
Ok(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
TestExternalities::default().execute_with(|| {
|
TestExternalities::default().execute_with(|| {
|
||||||
|
|||||||
Reference in New Issue
Block a user