From 0ba0d5167370db5fd0eb62e59e609945e505dff9 Mon Sep 17 00:00:00 2001 From: Aviv Greenburg Date: Tue, 10 Dec 2024 18:21:00 +0200 Subject: [PATCH] fix(blockifier): fix derives of GasAmount --- crates/blockifier/src/bouncer.rs | 13 ++----------- crates/starknet_api/src/execution_resources.rs | 12 ++++++++---- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/crates/blockifier/src/bouncer.rs b/crates/blockifier/src/bouncer.rs index 99c9345184..bd05ed6250 100644 --- a/crates/blockifier/src/bouncer.rs +++ b/crates/blockifier/src/bouncer.rs @@ -80,17 +80,8 @@ impl SerializeConfig for BouncerConfig { } } -#[derive( - Clone, - Copy, - Debug, - derive_more::Add, - derive_more::AddAssign, - derive_more::Sub, - Deserialize, - PartialEq, - Serialize, -)] +#[cfg_attr(any(test, feature = "testing"), derive(derive_more::Add, derive_more::AddAssign,))] +#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)] /// Represents the execution resources counted throughout block creation. pub struct BouncerWeights { pub builtin_count: BuiltinCount, diff --git a/crates/starknet_api/src/execution_resources.rs b/crates/starknet_api/src/execution_resources.rs index 63577a1cce..2ac0aaf7cc 100644 --- a/crates/starknet_api/src/execution_resources.rs +++ b/crates/starknet_api/src/execution_resources.rs @@ -9,13 +9,17 @@ use crate::transaction::fields::{Fee, Resource}; #[cfg_attr( any(test, feature = "testing"), - derive(derive_more::Sum, derive_more::Div, derive_more::SubAssign) + derive( + derive_more::Sum, + derive_more::Sub, + derive_more::Add, + derive_more::AddAssign, + derive_more::Div, + derive_more::SubAssign + ) )] #[derive( derive_more::Display, - derive_more::Sub, - derive_more::Add, - derive_more::AddAssign, Clone, Copy, Debug,