Function orml_utilities::with_transaction_result
source · pub fn with_transaction_result<R>(
f: impl FnOnce() -> Result<R, DispatchError>
) -> Result<R, DispatchError>
Expand description
Execute the supplied function in a new storage transaction.
All changes to storage performed by the supplied function are discarded if
the returned outcome is Result::Err
.
Transactions can be nested to any depth. Commits happen to the parent transaction.