From 92fe5b45ec4de850f279add3a284a5bc2e727a2c Mon Sep 17 00:00:00 2001 From: Andronik Date: Thu, 23 Mar 2023 16:42:53 +0100 Subject: [PATCH] propagate tx submission error --- runtime/parachains/src/disputes/slashing.rs | 36 ++++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/runtime/parachains/src/disputes/slashing.rs b/runtime/parachains/src/disputes/slashing.rs index 23e31a826254..d93bfa499d7e 100644 --- a/runtime/parachains/src/disputes/slashing.rs +++ b/runtime/parachains/src/disputes/slashing.rs @@ -705,22 +705,26 @@ where }; match SubmitTransaction::>::submit_unsigned_transaction(call.into()) { - Ok(()) => log::info!( - target: LOG_TARGET, - "Submitted dispute slashing report, session({}), index({}), kind({:?})", - session_index, - validator_index, - kind, - ), - Err(()) => log::error!( - target: LOG_TARGET, - "Error submitting dispute slashing report, session({}), index({}), kind({:?})", - session_index, - validator_index, - kind, - ), + Ok(()) => { + log::info!( + target: LOG_TARGET, + "Submitted dispute slashing report, session({}), index({}), kind({:?})", + session_index, + validator_index, + kind, + ); + Ok(()) + }, + Err(()) => { + log::error!( + target: LOG_TARGET, + "Error submitting dispute slashing report, session({}), index({}), kind({:?})", + session_index, + validator_index, + kind, + ); + Err(sp_runtime::DispatchError::Other("")) + }, } - - Ok(()) } }