Function frame_support::storage::transactional::with_transaction
source · pub fn with_transaction<T, E, F>(f: F) -> Result<T, E>where
E: From<DispatchError>,
F: FnOnce() -> TransactionOutcome<Result<T, E>>,
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 TransactionOutcome::Rollback
.
Transactions can be nested up to TRANSACTIONAL_LIMIT
times; more than that will result in an
error.
Commits happen to the parent transaction.