pub fn with_transaction<T, E, F>(f: F) -> 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.