From 9dbb7dc237adc4af92a355fb95e0623d8bfea120 Mon Sep 17 00:00:00 2001 From: meship-starkware Date: Mon, 29 Jul 2024 10:11:42 +0300 Subject: [PATCH] refactor(execution): put all create for testing methods under testing config refactor(execution): put all create for testing methods under testing config --- crates/blockifier/src/transaction/transactions.rs | 1 + crates/gateway/src/config.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/blockifier/src/transaction/transactions.rs b/crates/blockifier/src/transaction/transactions.rs index 830efbd7b3..55b6536336 100644 --- a/crates/blockifier/src/transaction/transactions.rs +++ b/crates/blockifier/src/transaction/transactions.rs @@ -508,6 +508,7 @@ impl L1HandlerTransaction { self.tx.calldata.0.len() - 1 } + #[cfg(any(test, feature = "testing"))] pub fn create_for_testing(l1_fee: Fee, contract_address: ContractAddress) -> Self { let calldata = calldata![ Felt::from(0x123), // from_address. diff --git a/crates/gateway/src/config.rs b/crates/gateway/src/config.rs index 49970fa7a0..1f3b504774 100644 --- a/crates/gateway/src/config.rs +++ b/crates/gateway/src/config.rs @@ -207,7 +207,7 @@ impl Default for ChainInfoConfig { ChainInfo::default().into() } } - +#[cfg(any(test, feature = "testing"))] impl ChainInfoConfig { pub fn create_for_testing() -> Self { BlockContext::create_for_testing().chain_info().clone().into() @@ -285,6 +285,7 @@ impl SerializeConfig for StatefulTransactionValidatorConfig { } } +#[cfg(any(test, feature = "testing"))] impl StatefulTransactionValidatorConfig { pub fn create_for_testing() -> Self { StatefulTransactionValidatorConfig {