Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Adapt to TransactionOutcome changes
Browse files Browse the repository at this point in the history
  • Loading branch information
athei committed Jun 23, 2020
1 parent d34fad6 commit 4e58ce5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frame/contracts/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,14 @@ where
-> ExecResult
where F: FnOnce(&mut ExecutionContext<T, V, L>) -> ExecResult
{
use frame_support::storage::TransactionOutcome::*;
let (output, deferred) = {
let mut nested = self.nested(dest, trie_id);
let output = frame_support::storage::with_transaction(|| {
let output = func(&mut nested);
match output {
Ok(ref rv) if rv.is_success() => (output, frame_support::storage::TransactionOutcome::Commit),
_ => (output, frame_support::storage::TransactionOutcome::Rollback),
Ok(ref rv) if rv.is_success() => Commit(output),
_ => Rollback(output),
}
})?;
(output, nested.deferred)
Expand Down

0 comments on commit 4e58ce5

Please sign in to comment.