From 4307c6d1a9c993b79e42775be22c74167b33cadb Mon Sep 17 00:00:00 2001 From: Bryan Chen Date: Mon, 12 Oct 2020 18:16:01 +1300 Subject: [PATCH] handle returns correctly for transactional --- frame/support/procedural/src/transactional.rs | 2 +- frame/support/test/tests/storage_transaction.rs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/frame/support/procedural/src/transactional.rs b/frame/support/procedural/src/transactional.rs index fbd0c9ca0b3c4..6dedd92028e7d 100644 --- a/frame/support/procedural/src/transactional.rs +++ b/frame/support/procedural/src/transactional.rs @@ -29,7 +29,7 @@ pub fn transactional(_attr: TokenStream, input: TokenStream) -> Result DispatchResult { + Value::set(v); + Ok(()) + } + #[transactional] fn value_commits(v: u32) -> result::Result { - Value::set(v); + set_value(v)?; Ok(v) } #[transactional] fn value_rollbacks(v: u32) -> result::Result { - Value::set(v); + set_value(v)?; Err("nah") }