Skip to content

Commit

Permalink
fix(txpool): clone impl for FullTransactionEvent (#4020)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrasiuk authored Aug 1, 2023
1 parent 4688fd2 commit a371cb8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/transaction-pool/src/pool/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,17 @@ pub enum FullTransactionEvent<T: PoolTransaction> {
impl<T: PoolTransaction> Clone for FullTransactionEvent<T> {
fn clone(&self) -> Self {
match self {
Self::Pending(hash) => Self::Pending(*hash),
Self::Queued(hash) => Self::Queued(*hash),
Self::Mined { tx_hash, block_hash } => {
Self::Mined { tx_hash: *tx_hash, block_hash: *block_hash }
}
Self::Replaced { transaction, replaced_by } => {
Self::Replaced { transaction: Arc::clone(transaction), replaced_by: *replaced_by }
}
other => other.clone(),
Self::Discarded(hash) => Self::Discarded(*hash),
Self::Invalid(hash) => Self::Invalid(*hash),
Self::Propagated(propagated) => Self::Propagated(Arc::clone(propagated)),
}
}
}
Expand Down

0 comments on commit a371cb8

Please sign in to comment.