From c7f1290fccf5fcb0ccdd8b0af0ed1fe9cd2a40df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Miko=C5=82ajczyk?= Date: Fri, 6 Oct 2023 15:48:43 +0200 Subject: [PATCH 1/2] Make `ExecResult` encodable --- substrate/frame/contracts/src/exec.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/substrate/frame/contracts/src/exec.rs b/substrate/frame/contracts/src/exec.rs index 9090aa9cb112b..1637dad1600ee 100644 --- a/substrate/frame/contracts/src/exec.rs +++ b/substrate/frame/contracts/src/exec.rs @@ -101,6 +101,7 @@ impl Key { /// in those to the caller. This enum is for the caller to distinguish whether the error /// happened during the execution of the callee or in the current execution context. #[cfg_attr(test, derive(Debug, PartialEq))] +#[derive(Copy, Clone, PartialEq, Eq, Debug, codec::Decode, codec::Encode)] pub enum ErrorOrigin { /// Caller error origin. /// @@ -113,6 +114,7 @@ pub enum ErrorOrigin { /// Error returned by contract execution. #[cfg_attr(test, derive(Debug, PartialEq))] +#[derive(Copy, Clone, PartialEq, Eq, Debug, codec::Decode, codec::Encode)] pub struct ExecError { /// The reason why the execution failed. pub error: DispatchError, From b5a11182c0a4b88d9d53b388dcbaf3fe63a371e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Miko=C5=82ajczyk?= Date: Tue, 10 Oct 2023 21:01:36 +0200 Subject: [PATCH 2/2] Remove redundant derives --- substrate/frame/contracts/src/exec.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/substrate/frame/contracts/src/exec.rs b/substrate/frame/contracts/src/exec.rs index 1637dad1600ee..c26d82f7f110c 100644 --- a/substrate/frame/contracts/src/exec.rs +++ b/substrate/frame/contracts/src/exec.rs @@ -100,7 +100,6 @@ impl Key { /// Call or instantiate both called into other contracts and pass through errors happening /// in those to the caller. This enum is for the caller to distinguish whether the error /// happened during the execution of the callee or in the current execution context. -#[cfg_attr(test, derive(Debug, PartialEq))] #[derive(Copy, Clone, PartialEq, Eq, Debug, codec::Decode, codec::Encode)] pub enum ErrorOrigin { /// Caller error origin. @@ -113,7 +112,6 @@ pub enum ErrorOrigin { } /// Error returned by contract execution. -#[cfg_attr(test, derive(Debug, PartialEq))] #[derive(Copy, Clone, PartialEq, Eq, Debug, codec::Decode, codec::Encode)] pub struct ExecError { /// The reason why the execution failed.