From d66bb5cf78653ecc1899b7f308320332589be6c0 Mon Sep 17 00:00:00 2001 From: meship-starkware Date: Tue, 23 Jul 2024 13:27:28 +0300 Subject: [PATCH] fix(transaction): add clone to declare tx --- crates/blockifier/src/transaction/account_transaction.rs | 2 +- crates/blockifier/src/transaction/transaction_execution.rs | 2 +- crates/blockifier/src/transaction/transactions.rs | 4 ++-- crates/papyrus_monitoring_gateway/src/lib.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/blockifier/src/transaction/account_transaction.rs b/crates/blockifier/src/transaction/account_transaction.rs index 56ecba63bf..3386335084 100644 --- a/crates/blockifier/src/transaction/account_transaction.rs +++ b/crates/blockifier/src/transaction/account_transaction.rs @@ -63,7 +63,7 @@ mod flavors_test; mod post_execution_test; /// Represents a paid Starknet transaction. -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum AccountTransaction { Declare(DeclareTransaction), DeployAccount(DeployAccountTransaction), diff --git a/crates/blockifier/src/transaction/transaction_execution.rs b/crates/blockifier/src/transaction/transaction_execution.rs index 9d0b209c7b..882b4c2b8e 100644 --- a/crates/blockifier/src/transaction/transaction_execution.rs +++ b/crates/blockifier/src/transaction/transaction_execution.rs @@ -30,7 +30,7 @@ use crate::transaction::transactions::{ }; // TODO: Move into transaction.rs, makes more sense to be defined there. -#[derive(Debug, derive_more::From)] +#[derive(Debug, Clone, derive_more::From)] pub enum Transaction { AccountTransaction(AccountTransaction), L1HandlerTransaction(L1HandlerTransaction), diff --git a/crates/blockifier/src/transaction/transactions.rs b/crates/blockifier/src/transaction/transactions.rs index 830efbd7b3..f314eaed86 100644 --- a/crates/blockifier/src/transaction/transactions.rs +++ b/crates/blockifier/src/transaction/transactions.rs @@ -128,7 +128,7 @@ pub trait ValidatableTransaction { ) -> TransactionExecutionResult>; } -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct DeclareTransaction { pub tx: starknet_api::transaction::DeclareTransaction, pub tx_hash: TransactionHash, @@ -495,7 +495,7 @@ impl TransactionInfoCreator for InvokeTransaction { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct L1HandlerTransaction { pub tx: starknet_api::transaction::L1HandlerTransaction, pub tx_hash: TransactionHash, diff --git a/crates/papyrus_monitoring_gateway/src/lib.rs b/crates/papyrus_monitoring_gateway/src/lib.rs index 823b2044f2..1f7e068c91 100644 --- a/crates/papyrus_monitoring_gateway/src/lib.rs +++ b/crates/papyrus_monitoring_gateway/src/lib.rs @@ -313,7 +313,7 @@ async fn node_config_by_secret( async fn metrics(prometheus_handle: Option) -> Response { match prometheus_handle { Some(handle) => { - Collector::default().prefix(PROCESS_METRICS_PREFIX).collect(); + Collector::new(PROCESS_METRICS_PREFIX).collect(); handle.render().into_response() } None => StatusCode::METHOD_NOT_ALLOWED.into_response(),