From 81f2ceef8038d3283f386d9600d3c2706c2b305e Mon Sep 17 00:00:00 2001 From: teor Date: Wed, 25 Aug 2021 08:56:11 +1000 Subject: [PATCH] Derive Copy and Clone for zebra-consensus errors (#2664) Co-authored-by: Marek --- zebra-consensus/src/error.rs | 6 +++--- zebra-script/src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zebra-consensus/src/error.rs b/zebra-consensus/src/error.rs index 7ec970c1..0e324ec7 100644 --- a/zebra-consensus/src/error.rs +++ b/zebra-consensus/src/error.rs @@ -9,7 +9,7 @@ use thiserror::Error; use crate::BoxError; -#[derive(Error, Debug, PartialEq)] +#[derive(Error, Copy, Clone, Debug, PartialEq)] pub enum SubsidyError { #[error("no coinbase transaction in block")] NoCoinbase, @@ -18,7 +18,7 @@ pub enum SubsidyError { FoundersRewardNotFound, } -#[derive(Error, Debug, PartialEq)] +#[derive(Error, Clone, Debug, PartialEq)] pub enum TransactionError { #[error("first transaction must be coinbase")] CoinbasePosition, @@ -108,7 +108,7 @@ impl From for BlockError { } } -#[derive(Error, Debug, PartialEq)] +#[derive(Error, Clone, Debug, PartialEq)] pub enum BlockError { #[error("block contains invalid transactions")] Transaction(#[from] TransactionError), diff --git a/zebra-script/src/lib.rs b/zebra-script/src/lib.rs index e81dbd3f..9fcfd56e 100644 --- a/zebra-script/src/lib.rs +++ b/zebra-script/src/lib.rs @@ -24,7 +24,7 @@ use zebra_chain::{ transparent, }; -#[derive(Debug, Display, Error, PartialEq)] +#[derive(Copy, Clone, Debug, Display, Error, PartialEq)] #[non_exhaustive] /// An Error type representing the error codes returned from zcash_script. pub enum Error {