chore: expand derives for u8 enums created by macro

This commit is contained in:
Jude Nelson
2022-09-08 14:58:46 -04:00
parent a92f97e5d2
commit 522c074487

View File

@@ -209,7 +209,7 @@ macro_rules! guarded_string {
macro_rules! define_u8_enum {
($Name:ident { $($Variant:ident = $Val:literal),+ }) =>
{
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
#[repr(u8)]
pub enum $Name {
$($Variant = $Val),*,
@@ -560,7 +560,7 @@ macro_rules! impl_byte_array_serde {
#[macro_export]
macro_rules! test_debug {
($($arg:tt)*) => (
#[cfg(test)]
#[cfg(any(test, feature = "testing"))]
{
use std::env;
if env::var("BLOCKSTACK_DEBUG") == Ok("1".to_string()) {
@@ -588,7 +588,7 @@ pub fn is_trace() -> bool {
#[allow(unused_macros)]
macro_rules! trace {
($($arg:tt)*) => (
#[cfg(test)]
#[cfg(any(test, feature = "testing"))]
{
if crate::util::macros::is_trace() {
debug!($($arg)*);