Skip to content

Commit

Permalink
Derive Clone on filters
Browse files Browse the repository at this point in the history
  • Loading branch information
banool committed Jun 14, 2024
1 parent 13a63d8 commit 35c362a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions rust/transaction-filter/src/boolean_transaction_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::fmt::Debug;

/// BooleanTransactionFilter is the top level filter
#[derive(Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(untagged)]
pub enum BooleanTransactionFilter {
And(LogicalAnd),
Expand Down Expand Up @@ -95,7 +95,7 @@ impl Filterable<Transaction> for BooleanTransactionFilter {
}
}

#[derive(Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct LogicalAnd {
and: Vec<BooleanTransactionFilter>,
}
Expand All @@ -113,7 +113,7 @@ impl Filterable<Transaction> for LogicalAnd {
}
}

#[derive(Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct LogicalOr {
or: Vec<BooleanTransactionFilter>,
}
Expand All @@ -131,7 +131,7 @@ impl Filterable<Transaction> for LogicalOr {
}
}

#[derive(Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct LogicalNot {
not: Box<BooleanTransactionFilter>,
}
Expand All @@ -147,7 +147,7 @@ impl Filterable<Transaction> for LogicalNot {
}

/// These are filters we would expect to be exposed via API
#[derive(Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
#[serde(tag = "type")]
pub enum APIFilter {
Expand Down
2 changes: 1 addition & 1 deletion rust/transaction-filter/src/filters/transaction_root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use anyhow::Error;
use aptos_protos::transaction::v1::{transaction::TransactionType, Transaction};
use serde::{Deserialize, Serialize};

#[derive(Debug, Default, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
#[derive(derive_builder::Builder)]
#[builder(setter(strip_option), default)]
Expand Down

0 comments on commit 35c362a

Please sign in to comment.