From 0985260666d48407259d47f691e061300c0e75e7 Mon Sep 17 00:00:00 2001 From: Arni Hod Date: Tue, 8 Oct 2024 08:45:21 +0300 Subject: [PATCH] chore: remove public imports from starknet api transaction --- .../src/blockifier/stateful_validator_test.rs | 3 +- .../blockifier/transaction_executor_test.rs | 3 +- crates/blockifier/src/bouncer_test.rs | 2 +- .../blockifier/src/concurrency/fee_utils.rs | 2 +- .../src/concurrency/fee_utils_test.rs | 4 +- .../src/concurrency/versioned_state_test.rs | 2 +- .../src/concurrency/worker_logic_test.rs | 8 +--- crates/blockifier/src/context.rs | 6 ++- .../src/execution/contract_address_test.rs | 2 +- .../src/execution/contract_class.rs | 2 +- .../deprecated_syscalls_test.rs | 4 +- .../deprecated_syscalls/hint_processor.rs | 2 +- .../src/execution/deprecated_syscalls/mod.rs | 10 +---- .../blockifier/src/execution/entry_point.rs | 4 +- .../src/execution/entry_point_test.rs | 2 +- .../src/execution/execution_utils.rs | 2 +- .../src/execution/stack_trace_test.rs | 4 +- .../src/execution/syscalls/hint_processor.rs | 7 +++- .../blockifier/src/execution/syscalls/mod.rs | 10 +---- .../syscalls/syscall_tests/call_contract.rs | 2 +- .../syscalls/syscall_tests/deploy.rs | 2 +- .../syscalls/syscall_tests/emit_event.rs | 3 +- .../syscall_tests/get_execution_info.rs | 6 +-- .../syscalls/syscall_tests/keccak.rs | 2 +- .../syscalls/syscall_tests/library_call.rs | 2 +- .../execution/syscalls/syscall_tests/secp.rs | 2 +- .../syscall_tests/send_message_to_l1.rs | 3 +- .../syscalls/syscall_tests/sha256.rs | 2 +- crates/blockifier/src/fee/fee_checks.rs | 9 ++++- crates/blockifier/src/fee/fee_test.rs | 2 +- crates/blockifier/src/fee/fee_utils.rs | 4 +- crates/blockifier/src/fee/gas_usage.rs | 2 +- crates/blockifier/src/fee/gas_usage_test.rs | 3 +- crates/blockifier/src/fee/receipt.rs | 2 +- crates/blockifier/src/fee/receipt_test.rs | 3 +- crates/blockifier/src/fee/resources.rs | 2 +- .../blockifier/src/state/cached_state_test.rs | 2 +- crates/blockifier/src/test_utils.rs | 4 +- .../src/test_utils/initial_test_state.rs | 2 +- .../blockifier/src/test_utils/l1_handler.rs | 3 +- crates/blockifier/src/test_utils/syscall.rs | 2 +- .../src/test_utils/transfers_generator.rs | 3 +- .../src/transaction/account_transaction.rs | 7 ++-- .../transaction/account_transactions_test.rs | 6 +-- crates/blockifier/src/transaction/errors.rs | 3 +- .../src/transaction/execution_flavors_test.rs | 4 +- crates/blockifier/src/transaction/objects.rs | 10 +++-- .../src/transaction/post_execution_test.rs | 4 +- .../blockifier/src/transaction/test_utils.rs | 10 +++-- .../src/transaction/transaction_execution.rs | 3 +- .../src/transaction/transactions.rs | 8 ++-- .../src/transaction/transactions_test.rs | 16 ++++---- crates/blockifier/src/versioned_constants.rs | 2 +- .../committer_cli/src/tests/utils/objects.rs | 3 +- crates/gateway/src/errors.rs | 2 +- crates/gateway/src/state_reader_test_utils.rs | 2 +- .../stateful_transaction_validator_test.rs | 2 +- .../src/stateless_transaction_validator.rs | 2 +- .../stateless_transaction_validator_test.rs | 2 +- crates/mempool/src/mempool.rs | 3 +- crates/mempool/src/test_utils.rs | 4 +- crates/mempool/src/transaction_queue.rs | 3 +- .../src/starknet_api_test_utils.rs | 4 +- .../src/py_block_executor.rs | 2 +- crates/native_blockifier/src/py_declare.rs | 12 +++--- .../src/py_deploy_account.rs | 10 +++-- .../src/py_invoke_function.rs | 10 +++-- crates/native_blockifier/src/py_l1_handler.rs | 3 +- .../native_blockifier/src/py_transaction.rs | 10 ++--- .../papyrus_execution/src/execution_test.rs | 2 +- crates/papyrus_execution/src/lib.rs | 3 +- crates/papyrus_execution/src/objects.rs | 3 +- crates/papyrus_execution/src/test_utils.rs | 2 +- .../src/testing_instances.rs | 3 +- .../src/converters/consensus_test.rs | 2 +- .../src/converters/receipt.rs | 2 +- .../src/converters/rpc_transaction.rs | 3 +- .../src/converters/rpc_transaction_test.rs | 2 +- .../src/converters/transaction.rs | 16 ++++---- .../src/converters/transaction_test.rs | 4 +- crates/papyrus_rpc/src/api.rs | 2 +- crates/papyrus_rpc/src/v0_8/api/api_impl.rs | 2 +- crates/papyrus_rpc/src/v0_8/api/mod.rs | 3 +- .../src/v0_8/broadcasted_transaction.rs | 4 +- .../src/v0_8/broadcasted_transaction_test.rs | 2 +- crates/papyrus_rpc/src/v0_8/execution_test.rs | 3 +- crates/papyrus_rpc/src/v0_8/transaction.rs | 38 ++++++++++--------- .../papyrus_rpc/src/v0_8/transaction_test.rs | 6 +-- .../tests/gateway_integration_test.rs | 3 +- .../src/serialization/serializers.rs | 18 +++++---- crates/papyrus_test_utils/src/lib.rs | 18 +++++---- crates/starknet_api/src/block.rs | 3 +- .../src/block_hash/block_hash_calculator.rs | 10 +---- .../block_hash/block_hash_calculator_test.rs | 3 +- .../starknet_api/src/block_hash/test_utils.rs | 2 +- .../src/block_hash/transaction_commitment.rs | 3 +- .../block_hash/transaction_commitment_test.rs | 3 +- crates/starknet_api/src/core.rs | 2 +- crates/starknet_api/src/core_test.rs | 2 +- .../src/executable_transaction.rs | 6 +-- .../starknet_api/src/execution_resources.rs | 2 +- crates/starknet_api/src/rpc_transaction.rs | 12 +++--- .../starknet_api/src/rpc_transaction_test.rs | 2 +- crates/starknet_api/src/test_utils/declare.rs | 14 ++++--- .../src/test_utils/deploy_account.rs | 14 ++++--- crates/starknet_api/src/test_utils/invoke.rs | 12 +++--- crates/starknet_api/src/transaction.rs | 8 +--- crates/starknet_api/src/transaction_hash.rs | 4 +- .../src/reader/objects/test_utils.rs | 14 ++++--- .../src/reader/objects/transaction.rs | 14 ++++--- .../starknet_feeder_gateway_client_test.rs | 3 +- .../src/writer/objects/transaction.rs | 4 +- crates/tests-integration/src/state_reader.rs | 2 +- 113 files changed, 299 insertions(+), 274 deletions(-) diff --git a/crates/blockifier/src/blockifier/stateful_validator_test.rs b/crates/blockifier/src/blockifier/stateful_validator_test.rs index 42b2b57b04..e1de6ee725 100644 --- a/crates/blockifier/src/blockifier/stateful_validator_test.rs +++ b/crates/blockifier/src/blockifier/stateful_validator_test.rs @@ -1,6 +1,7 @@ use assert_matches::assert_matches; use rstest::rstest; -use starknet_api::transaction::{TransactionVersion, ValidResourceBounds}; +use starknet_api::transaction::fields::ValidResourceBounds; +use starknet_api::transaction::TransactionVersion; use crate::blockifier::stateful_validator::StatefulValidator; use crate::context::BlockContext; diff --git a/crates/blockifier/src/blockifier/transaction_executor_test.rs b/crates/blockifier/src/blockifier/transaction_executor_test.rs index 4259c207d6..3089818a87 100644 --- a/crates/blockifier/src/blockifier/transaction_executor_test.rs +++ b/crates/blockifier/src/blockifier/transaction_executor_test.rs @@ -2,7 +2,8 @@ use assert_matches::assert_matches; use pretty_assertions::assert_eq; use rstest::rstest; use starknet_api::test_utils::NonceManager; -use starknet_api::transaction::{Fee, TransactionVersion}; +use starknet_api::transaction::fields::Fee; +use starknet_api::transaction::TransactionVersion; use starknet_api::{declare_tx_args, deploy_account_tx_args, felt, invoke_tx_args, nonce}; use starknet_types_core::felt::Felt; diff --git a/crates/blockifier/src/bouncer_test.rs b/crates/blockifier/src/bouncer_test.rs index 7b65391c65..24ee237b9e 100644 --- a/crates/blockifier/src/bouncer_test.rs +++ b/crates/blockifier/src/bouncer_test.rs @@ -4,7 +4,7 @@ use assert_matches::assert_matches; use cairo_vm::types::builtin_name::BuiltinName; use cairo_vm::vm::runners::cairo_runner::ExecutionResources; use rstest::rstest; -use starknet_api::transaction::Fee; +use starknet_api::transaction::fields::Fee; use starknet_api::{class_hash, contract_address, storage_key}; use super::BouncerConfig; diff --git a/crates/blockifier/src/concurrency/fee_utils.rs b/crates/blockifier/src/concurrency/fee_utils.rs index f31d134708..8ea34ea065 100644 --- a/crates/blockifier/src/concurrency/fee_utils.rs +++ b/crates/blockifier/src/concurrency/fee_utils.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use num_traits::ToPrimitive; use starknet_api::core::ContractAddress; -use starknet_api::transaction::Fee; +use starknet_api::transaction::fields::Fee; use starknet_types_core::felt::Felt; use crate::context::{BlockContext, TransactionContext}; diff --git a/crates/blockifier/src/concurrency/fee_utils_test.rs b/crates/blockifier/src/concurrency/fee_utils_test.rs index 44619d8cf1..d5884c4530 100644 --- a/crates/blockifier/src/concurrency/fee_utils_test.rs +++ b/crates/blockifier/src/concurrency/fee_utils_test.rs @@ -1,6 +1,6 @@ use num_bigint::BigUint; use rstest::rstest; -use starknet_api::transaction::{Fee, ValidResourceBounds}; +use starknet_api::transaction::fields::{Fee, ValidResourceBounds}; use starknet_api::{felt, invoke_tx_args}; use starknet_types_core::felt::Felt; @@ -56,7 +56,7 @@ pub fn test_fill_sequencer_balance_reads( #[case::overflow(Fee(150_u128), felt!(u128::MAX), felt!(5_u128))] #[case::overflow_edge_case(Fee(500_u128), felt!(u128::MAX), felt!(u128::MAX-1))] pub fn test_add_fee_to_sequencer_balance( - #[case] actual_fee: starknet_api::transaction::Fee, + #[case] actual_fee: Fee, #[case] sequencer_balance_low: Felt, #[case] sequencer_balance_high: Felt, ) { diff --git a/crates/blockifier/src/concurrency/versioned_state_test.rs b/crates/blockifier/src/concurrency/versioned_state_test.rs index 261e175f59..0522800127 100644 --- a/crates/blockifier/src/concurrency/versioned_state_test.rs +++ b/crates/blockifier/src/concurrency/versioned_state_test.rs @@ -6,7 +6,7 @@ use assert_matches::assert_matches; use rstest::{fixture, rstest}; use starknet_api::core::{calculate_contract_address, ClassHash, ContractAddress}; use starknet_api::test_utils::NonceManager; -use starknet_api::transaction::{ContractAddressSalt, ValidResourceBounds}; +use starknet_api::transaction::fields::{ContractAddressSalt, ValidResourceBounds}; use starknet_api::{ calldata, class_hash, diff --git a/crates/blockifier/src/concurrency/worker_logic_test.rs b/crates/blockifier/src/concurrency/worker_logic_test.rs index 4b7ed1a6cf..3bb1dad82f 100644 --- a/crates/blockifier/src/concurrency/worker_logic_test.rs +++ b/crates/blockifier/src/concurrency/worker_logic_test.rs @@ -4,12 +4,8 @@ use std::sync::Mutex; use rstest::rstest; use starknet_api::core::{ContractAddress, Nonce}; use starknet_api::test_utils::NonceManager; -use starknet_api::transaction::{ - ContractAddressSalt, - Fee, - TransactionVersion, - ValidResourceBounds, -}; +use starknet_api::transaction::fields::{ContractAddressSalt, Fee, ValidResourceBounds}; +use starknet_api::transaction::TransactionVersion; use starknet_api::{contract_address, declare_tx_args, felt, invoke_tx_args, nonce, storage_key}; use starknet_types_core::felt::Felt; diff --git a/crates/blockifier/src/context.rs b/crates/blockifier/src/context.rs index b6a0333a86..e77c5e0382 100644 --- a/crates/blockifier/src/context.rs +++ b/crates/blockifier/src/context.rs @@ -5,7 +5,11 @@ use papyrus_config::{ParamPath, ParamPrivacyInput, SerializedParam}; use serde::{Deserialize, Serialize}; use starknet_api::block::GasPriceVector; use starknet_api::core::{ChainId, ContractAddress}; -use starknet_api::transaction::{AllResourceBounds, GasVectorComputationMode, ValidResourceBounds}; +use starknet_api::transaction::fields::{ + AllResourceBounds, + GasVectorComputationMode, + ValidResourceBounds, +}; use crate::blockifier::block::BlockInfo; use crate::bouncer::BouncerConfig; diff --git a/crates/blockifier/src/execution/contract_address_test.rs b/crates/blockifier/src/execution/contract_address_test.rs index f30c1445e0..cf20aa5f89 100644 --- a/crates/blockifier/src/execution/contract_address_test.rs +++ b/crates/blockifier/src/execution/contract_address_test.rs @@ -1,6 +1,6 @@ use rstest::rstest; use starknet_api::core::{calculate_contract_address, ClassHash, ContractAddress}; -use starknet_api::transaction::{Calldata, ContractAddressSalt}; +use starknet_api::transaction::fields::{Calldata, ContractAddressSalt}; use starknet_api::{calldata, felt}; use crate::abi::abi_utils::selector_from_name; diff --git a/crates/blockifier/src/execution/contract_class.rs b/crates/blockifier/src/execution/contract_class.rs index 33ca5e2024..df332829f2 100644 --- a/crates/blockifier/src/execution/contract_class.rs +++ b/crates/blockifier/src/execution/contract_class.rs @@ -29,7 +29,7 @@ use starknet_api::deprecated_contract_class::{ EntryPointV0, Program as DeprecatedProgram, }; -use starknet_api::transaction::GasVectorComputationMode; +use starknet_api::transaction::fields::GasVectorComputationMode; use starknet_types_core::felt::Felt; use crate::abi::constants::{self}; diff --git a/crates/blockifier/src/execution/deprecated_syscalls/deprecated_syscalls_test.rs b/crates/blockifier/src/execution/deprecated_syscalls/deprecated_syscalls_test.rs index 680ba36b94..0223238347 100644 --- a/crates/blockifier/src/execution/deprecated_syscalls/deprecated_syscalls_test.rs +++ b/crates/blockifier/src/execution/deprecated_syscalls/deprecated_syscalls_test.rs @@ -7,13 +7,11 @@ use pretty_assertions::assert_eq; use rstest::rstest; use starknet_api::core::{calculate_contract_address, ChainId}; use starknet_api::state::StorageKey; +use starknet_api::transaction::fields::{Calldata, ContractAddressSalt, Fee}; use starknet_api::transaction::{ - Calldata, - ContractAddressSalt, EventContent, EventData, EventKey, - Fee, TransactionHash, TransactionVersion, QUERY_VERSION_BASE_BIT, diff --git a/crates/blockifier/src/execution/deprecated_syscalls/hint_processor.rs b/crates/blockifier/src/execution/deprecated_syscalls/hint_processor.rs index 4cb8d872d5..c94c4f8806 100644 --- a/crates/blockifier/src/execution/deprecated_syscalls/hint_processor.rs +++ b/crates/blockifier/src/execution/deprecated_syscalls/hint_processor.rs @@ -20,7 +20,7 @@ use num_bigint::{BigUint, TryFromBigIntError}; use starknet_api::contract_class::EntryPointType; use starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector}; use starknet_api::state::StorageKey; -use starknet_api::transaction::Calldata; +use starknet_api::transaction::fields::Calldata; use starknet_api::StarknetApiError; use starknet_types_core::felt::{Felt, FromStrError}; use thiserror::Error; diff --git a/crates/blockifier/src/execution/deprecated_syscalls/mod.rs b/crates/blockifier/src/execution/deprecated_syscalls/mod.rs index 5f61229f02..acdc54b386 100644 --- a/crates/blockifier/src/execution/deprecated_syscalls/mod.rs +++ b/crates/blockifier/src/execution/deprecated_syscalls/mod.rs @@ -11,14 +11,8 @@ use starknet_api::core::{ EthAddress, }; use starknet_api::state::StorageKey; -use starknet_api::transaction::{ - Calldata, - ContractAddressSalt, - EventContent, - EventData, - EventKey, - L2ToL1Payload, -}; +use starknet_api::transaction::fields::{Calldata, ContractAddressSalt}; +use starknet_api::transaction::{EventContent, EventData, EventKey, L2ToL1Payload}; use starknet_types_core::felt::Felt; use strum_macros::EnumIter; diff --git a/crates/blockifier/src/execution/entry_point.rs b/crates/blockifier/src/execution/entry_point.rs index 9bf38ebefa..9e57de5284 100644 --- a/crates/blockifier/src/execution/entry_point.rs +++ b/crates/blockifier/src/execution/entry_point.rs @@ -9,13 +9,13 @@ use serde::Serialize; use starknet_api::contract_class::EntryPointType; use starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector}; use starknet_api::state::StorageKey; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AllResourceBounds, Calldata, ResourceBounds, - TransactionVersion, ValidResourceBounds, }; +use starknet_api::transaction::TransactionVersion; use starknet_types_core::felt::Felt; use crate::abi::abi_utils::selector_from_name; diff --git a/crates/blockifier/src/execution/entry_point_test.rs b/crates/blockifier/src/execution/entry_point_test.rs index 4309796136..3b03761bec 100644 --- a/crates/blockifier/src/execution/entry_point_test.rs +++ b/crates/blockifier/src/execution/entry_point_test.rs @@ -5,7 +5,7 @@ use num_bigint::BigInt; use pretty_assertions::assert_eq; use starknet_api::core::EntryPointSelector; use starknet_api::execution_utils::format_panic_data; -use starknet_api::transaction::{Calldata, Fee}; +use starknet_api::transaction::fields::{Calldata, Fee}; use starknet_api::{calldata, felt, storage_key}; use crate::abi::abi_utils::{get_storage_var_address, selector_from_name}; diff --git a/crates/blockifier/src/execution/execution_utils.rs b/crates/blockifier/src/execution/execution_utils.rs index 7ee421d128..a687c7544d 100644 --- a/crates/blockifier/src/execution/execution_utils.rs +++ b/crates/blockifier/src/execution/execution_utils.rs @@ -18,7 +18,7 @@ use cairo_vm::vm::vm_core::VirtualMachine; use num_bigint::BigUint; use starknet_api::core::ClassHash; use starknet_api::deprecated_contract_class::Program as DeprecatedProgram; -use starknet_api::transaction::Calldata; +use starknet_api::transaction::fields::Calldata; use starknet_types_core::felt::Felt; use super::call_info::CallExecution; diff --git a/crates/blockifier/src/execution/stack_trace_test.rs b/crates/blockifier/src/execution/stack_trace_test.rs index 75cc8ccecf..ae3923cd0b 100644 --- a/crates/blockifier/src/execution/stack_trace_test.rs +++ b/crates/blockifier/src/execution/stack_trace_test.rs @@ -9,13 +9,13 @@ use starknet_api::core::{ EntryPointSelector, Nonce, }; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ ContractAddressSalt, Fee, TransactionSignature, - TransactionVersion, ValidResourceBounds, }; +use starknet_api::transaction::TransactionVersion; use starknet_api::{calldata, felt, invoke_tx_args}; use starknet_types_core::felt::Felt; diff --git a/crates/blockifier/src/execution/syscalls/hint_processor.rs b/crates/blockifier/src/execution/syscalls/hint_processor.rs index 3fd8060412..e6e3768b7e 100644 --- a/crates/blockifier/src/execution/syscalls/hint_processor.rs +++ b/crates/blockifier/src/execution/syscalls/hint_processor.rs @@ -16,7 +16,12 @@ use cairo_vm::vm::vm_core::VirtualMachine; use starknet_api::contract_class::EntryPointType; use starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector}; use starknet_api::state::StorageKey; -use starknet_api::transaction::{AllResourceBounds, Calldata, Resource, ValidResourceBounds}; +use starknet_api::transaction::fields::{ + AllResourceBounds, + Calldata, + Resource, + ValidResourceBounds, +}; use starknet_api::StarknetApiError; use starknet_types_core::felt::{Felt, FromStrError}; use thiserror::Error; diff --git a/crates/blockifier/src/execution/syscalls/mod.rs b/crates/blockifier/src/execution/syscalls/mod.rs index a906faf81e..b10b463ddd 100644 --- a/crates/blockifier/src/execution/syscalls/mod.rs +++ b/crates/blockifier/src/execution/syscalls/mod.rs @@ -11,14 +11,8 @@ use starknet_api::core::{ EthAddress, }; use starknet_api::state::StorageKey; -use starknet_api::transaction::{ - Calldata, - ContractAddressSalt, - EventContent, - EventData, - EventKey, - L2ToL1Payload, -}; +use starknet_api::transaction::fields::{Calldata, ContractAddressSalt}; +use starknet_api::transaction::{EventContent, EventData, EventKey, L2ToL1Payload}; use starknet_types_core::felt::Felt; use self::hint_processor::{ diff --git a/crates/blockifier/src/execution/syscalls/syscall_tests/call_contract.rs b/crates/blockifier/src/execution/syscalls/syscall_tests/call_contract.rs index c1dc0f94ab..d200b61244 100644 --- a/crates/blockifier/src/execution/syscalls/syscall_tests/call_contract.rs +++ b/crates/blockifier/src/execution/syscalls/syscall_tests/call_contract.rs @@ -6,7 +6,7 @@ use pretty_assertions::assert_eq; use rstest::rstest; use starknet_api::execution_utils::format_panic_data; use starknet_api::felt; -use starknet_api::transaction::Calldata; +use starknet_api::transaction::fields::Calldata; use test_case::test_case; use super::constants::REQUIRED_GAS_CALL_CONTRACT_TEST; diff --git a/crates/blockifier/src/execution/syscalls/syscall_tests/deploy.rs b/crates/blockifier/src/execution/syscalls/syscall_tests/deploy.rs index fb6fb408ec..c5a477c61e 100644 --- a/crates/blockifier/src/execution/syscalls/syscall_tests/deploy.rs +++ b/crates/blockifier/src/execution/syscalls/syscall_tests/deploy.rs @@ -1,6 +1,6 @@ use pretty_assertions::assert_eq; use starknet_api::core::calculate_contract_address; -use starknet_api::transaction::{Calldata, ContractAddressSalt, Fee}; +use starknet_api::transaction::fields::{Calldata, ContractAddressSalt, Fee}; use starknet_api::{calldata, felt}; use test_case::test_case; diff --git a/crates/blockifier/src/execution/syscalls/syscall_tests/emit_event.rs b/crates/blockifier/src/execution/syscalls/syscall_tests/emit_event.rs index de3ec46752..7bd8b7b18c 100644 --- a/crates/blockifier/src/execution/syscalls/syscall_tests/emit_event.rs +++ b/crates/blockifier/src/execution/syscalls/syscall_tests/emit_event.rs @@ -1,7 +1,8 @@ use itertools::concat; use pretty_assertions::assert_eq; use starknet_api::felt; -use starknet_api::transaction::{Calldata, EventContent, EventData, EventKey}; +use starknet_api::transaction::fields::Calldata; +use starknet_api::transaction::{EventContent, EventData, EventKey}; use starknet_types_core::felt::Felt; use test_case::test_case; diff --git a/crates/blockifier/src/execution/syscalls/syscall_tests/get_execution_info.rs b/crates/blockifier/src/execution/syscalls/syscall_tests/get_execution_info.rs index 73a84a9b35..3692b62e9d 100644 --- a/crates/blockifier/src/execution/syscalls/syscall_tests/get_execution_info.rs +++ b/crates/blockifier/src/execution/syscalls/syscall_tests/get_execution_info.rs @@ -4,7 +4,7 @@ use starknet_api::block::GasPrice; use starknet_api::core::ChainId; use starknet_api::data_availability::DataAvailabilityMode; use starknet_api::execution_resources::GasAmount; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AccountDeploymentData, Calldata, Fee, @@ -12,11 +12,9 @@ use starknet_api::transaction::{ Resource, ResourceBounds, Tip, - TransactionHash, - TransactionVersion, ValidResourceBounds, - QUERY_VERSION_BASE_BIT, }; +use starknet_api::transaction::{TransactionHash, TransactionVersion, QUERY_VERSION_BASE_BIT}; use starknet_api::{felt, nonce}; use starknet_types_core::felt::Felt; use test_case::test_case; diff --git a/crates/blockifier/src/execution/syscalls/syscall_tests/keccak.rs b/crates/blockifier/src/execution/syscalls/syscall_tests/keccak.rs index 3327f40c40..1fd523397e 100644 --- a/crates/blockifier/src/execution/syscalls/syscall_tests/keccak.rs +++ b/crates/blockifier/src/execution/syscalls/syscall_tests/keccak.rs @@ -1,4 +1,4 @@ -use starknet_api::transaction::Calldata; +use starknet_api::transaction::fields::Calldata; use test_case::test_case; use crate::abi::abi_utils::selector_from_name; diff --git a/crates/blockifier/src/execution/syscalls/syscall_tests/library_call.rs b/crates/blockifier/src/execution/syscalls/syscall_tests/library_call.rs index 9be9176521..0d71757d2f 100644 --- a/crates/blockifier/src/execution/syscalls/syscall_tests/library_call.rs +++ b/crates/blockifier/src/execution/syscalls/syscall_tests/library_call.rs @@ -4,7 +4,7 @@ use cairo_vm::types::builtin_name::BuiltinName; use cairo_vm::vm::runners::cairo_runner::ExecutionResources; use pretty_assertions::assert_eq; use starknet_api::execution_utils::format_panic_data; -use starknet_api::transaction::GasVectorComputationMode; +use starknet_api::transaction::fields::GasVectorComputationMode; use starknet_api::{calldata, felt, storage_key}; use test_case::test_case; diff --git a/crates/blockifier/src/execution/syscalls/syscall_tests/secp.rs b/crates/blockifier/src/execution/syscalls/syscall_tests/secp.rs index a3decf37b1..4b6f135a5a 100644 --- a/crates/blockifier/src/execution/syscalls/syscall_tests/secp.rs +++ b/crates/blockifier/src/execution/syscalls/syscall_tests/secp.rs @@ -1,4 +1,4 @@ -use starknet_api::transaction::Calldata; +use starknet_api::transaction::fields::Calldata; use test_case::test_case; use crate::abi::abi_utils::selector_from_name; diff --git a/crates/blockifier/src/execution/syscalls/syscall_tests/send_message_to_l1.rs b/crates/blockifier/src/execution/syscalls/syscall_tests/send_message_to_l1.rs index a052e080de..237c879765 100644 --- a/crates/blockifier/src/execution/syscalls/syscall_tests/send_message_to_l1.rs +++ b/crates/blockifier/src/execution/syscalls/syscall_tests/send_message_to_l1.rs @@ -1,7 +1,8 @@ use itertools::concat; use starknet_api::core::EthAddress; use starknet_api::felt; -use starknet_api::transaction::{Calldata, L2ToL1Payload}; +use starknet_api::transaction::fields::Calldata; +use starknet_api::transaction::L2ToL1Payload; use test_case::test_case; use crate::abi::abi_utils::selector_from_name; diff --git a/crates/blockifier/src/execution/syscalls/syscall_tests/sha256.rs b/crates/blockifier/src/execution/syscalls/syscall_tests/sha256.rs index bdeb68c5d6..43b10b7e9d 100644 --- a/crates/blockifier/src/execution/syscalls/syscall_tests/sha256.rs +++ b/crates/blockifier/src/execution/syscalls/syscall_tests/sha256.rs @@ -1,4 +1,4 @@ -use starknet_api::transaction::Calldata; +use starknet_api::transaction::fields::Calldata; use test_case::test_case; use crate::abi::abi_utils::selector_from_name; diff --git a/crates/blockifier/src/fee/fee_checks.rs b/crates/blockifier/src/fee/fee_checks.rs index 50a3820b1b..956c0853fc 100644 --- a/crates/blockifier/src/fee/fee_checks.rs +++ b/crates/blockifier/src/fee/fee_checks.rs @@ -1,6 +1,11 @@ use starknet_api::execution_resources::{GasAmount, GasVector}; -use starknet_api::transaction::Resource::{self, L1DataGas, L1Gas, L2Gas}; -use starknet_api::transaction::{AllResourceBounds, Fee, ResourceBounds, ValidResourceBounds}; +use starknet_api::transaction::fields::Resource::{self, L1DataGas, L1Gas, L2Gas}; +use starknet_api::transaction::fields::{ + AllResourceBounds, + Fee, + ResourceBounds, + ValidResourceBounds, +}; use starknet_types_core::felt::Felt; use thiserror::Error; diff --git a/crates/blockifier/src/fee/fee_test.rs b/crates/blockifier/src/fee/fee_test.rs index 33c32a77a8..e96f443431 100644 --- a/crates/blockifier/src/fee/fee_test.rs +++ b/crates/blockifier/src/fee/fee_test.rs @@ -4,7 +4,7 @@ use rstest::rstest; use starknet_api::block::{GasPrice, NonzeroGasPrice}; use starknet_api::execution_resources::{GasAmount, GasVector}; use starknet_api::invoke_tx_args; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AllResourceBounds, Fee, GasVectorComputationMode, diff --git a/crates/blockifier/src/fee/fee_utils.rs b/crates/blockifier/src/fee/fee_utils.rs index e6921029f4..7c73ace01d 100644 --- a/crates/blockifier/src/fee/fee_utils.rs +++ b/crates/blockifier/src/fee/fee_utils.rs @@ -6,8 +6,8 @@ use num_bigint::BigUint; use starknet_api::core::ContractAddress; use starknet_api::execution_resources::GasVector; use starknet_api::state::StorageKey; -use starknet_api::transaction::ValidResourceBounds::{AllResources, L1Gas}; -use starknet_api::transaction::{Fee, GasVectorComputationMode, Resource}; +use starknet_api::transaction::fields::ValidResourceBounds::{AllResources, L1Gas}; +use starknet_api::transaction::fields::{Fee, GasVectorComputationMode, Resource}; use starknet_types_core::felt::Felt; use crate::abi::abi_utils::get_fee_token_var_address; diff --git a/crates/blockifier/src/fee/gas_usage.rs b/crates/blockifier/src/fee/gas_usage.rs index bf5cfa5e8a..c8d00ca06f 100644 --- a/crates/blockifier/src/fee/gas_usage.rs +++ b/crates/blockifier/src/fee/gas_usage.rs @@ -1,6 +1,6 @@ use cairo_vm::vm::runners::cairo_runner::ExecutionResources; use starknet_api::execution_resources::GasVector; -use starknet_api::transaction::GasVectorComputationMode; +use starknet_api::transaction::fields::GasVectorComputationMode; use super::fee_utils::get_vm_resources_cost; use crate::abi::constants; diff --git a/crates/blockifier/src/fee/gas_usage_test.rs b/crates/blockifier/src/fee/gas_usage_test.rs index 7ef5134b12..153062234f 100644 --- a/crates/blockifier/src/fee/gas_usage_test.rs +++ b/crates/blockifier/src/fee/gas_usage_test.rs @@ -6,7 +6,8 @@ use rstest::{fixture, rstest}; use starknet_api::block::StarknetVersion; use starknet_api::execution_resources::{GasAmount, GasVector}; use starknet_api::invoke_tx_args; -use starknet_api::transaction::{EventContent, EventData, EventKey, GasVectorComputationMode}; +use starknet_api::transaction::fields::GasVectorComputationMode; +use starknet_api::transaction::{EventContent, EventData, EventKey}; use starknet_types_core::felt::Felt; use crate::abi::constants; diff --git a/crates/blockifier/src/fee/receipt.rs b/crates/blockifier/src/fee/receipt.rs index 5720417d50..05a403b080 100644 --- a/crates/blockifier/src/fee/receipt.rs +++ b/crates/blockifier/src/fee/receipt.rs @@ -1,7 +1,7 @@ use cairo_vm::vm::runners::cairo_runner::ExecutionResources; use starknet_api::core::ContractAddress; use starknet_api::execution_resources::GasVector; -use starknet_api::transaction::Fee; +use starknet_api::transaction::fields::Fee; use crate::context::TransactionContext; use crate::execution::call_info::ExecutionSummary; diff --git a/crates/blockifier/src/fee/receipt_test.rs b/crates/blockifier/src/fee/receipt_test.rs index 671b8c3285..95c315918b 100644 --- a/crates/blockifier/src/fee/receipt_test.rs +++ b/crates/blockifier/src/fee/receipt_test.rs @@ -1,6 +1,7 @@ use rstest::{fixture, rstest}; use starknet_api::execution_resources::GasVector; -use starknet_api::transaction::{GasVectorComputationMode, L2ToL1Payload}; +use starknet_api::transaction::fields::GasVectorComputationMode; +use starknet_api::transaction::L2ToL1Payload; use starknet_api::{invoke_tx_args, nonce}; use starknet_types_core::felt::Felt; diff --git a/crates/blockifier/src/fee/resources.rs b/crates/blockifier/src/fee/resources.rs index 9944a736b9..b92e50bf0e 100644 --- a/crates/blockifier/src/fee/resources.rs +++ b/crates/blockifier/src/fee/resources.rs @@ -1,7 +1,7 @@ use cairo_vm::vm::runners::cairo_runner::ExecutionResources; use starknet_api::core::ContractAddress; use starknet_api::execution_resources::{GasAmount, GasVector}; -use starknet_api::transaction::GasVectorComputationMode; +use starknet_api::transaction::fields::GasVectorComputationMode; use crate::execution::call_info::{EventSummary, ExecutionSummary}; use crate::fee::eth_gas_constants; diff --git a/crates/blockifier/src/state/cached_state_test.rs b/crates/blockifier/src/state/cached_state_test.rs index 569c38f828..21f856ec05 100644 --- a/crates/blockifier/src/state/cached_state_test.rs +++ b/crates/blockifier/src/state/cached_state_test.rs @@ -4,7 +4,7 @@ use assert_matches::assert_matches; use indexmap::indexmap; use pretty_assertions::assert_eq; use rstest::rstest; -use starknet_api::transaction::Fee; +use starknet_api::transaction::fields::Fee; use starknet_api::{class_hash, compiled_class_hash, contract_address, felt, nonce, storage_key}; use crate::context::{BlockContext, ChainInfo}; diff --git a/crates/blockifier/src/test_utils.rs b/crates/blockifier/src/test_utils.rs index 3fd1cf7bd2..be330d91a2 100644 --- a/crates/blockifier/src/test_utils.rs +++ b/crates/blockifier/src/test_utils.rs @@ -21,13 +21,13 @@ use starknet_api::core::{ClassHash, ContractAddress}; use starknet_api::execution_resources::{GasAmount, GasVector}; use starknet_api::hash::StarkHash; use starknet_api::state::StorageKey; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ Calldata, ContractAddressSalt, Fee, GasVectorComputationMode, - TransactionVersion, }; +use starknet_api::transaction::TransactionVersion; use starknet_api::{contract_address, felt}; use starknet_types_core::felt::Felt; diff --git a/crates/blockifier/src/test_utils/initial_test_state.rs b/crates/blockifier/src/test_utils/initial_test_state.rs index 82711da2ef..be87470367 100644 --- a/crates/blockifier/src/test_utils/initial_test_state.rs +++ b/crates/blockifier/src/test_utils/initial_test_state.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use starknet_api::core::ContractAddress; use starknet_api::felt; -use starknet_api::transaction::Fee; +use starknet_api::transaction::fields::Fee; use strum::IntoEnumIterator; use crate::abi::abi_utils::get_fee_token_var_address; diff --git a/crates/blockifier/src/test_utils/l1_handler.rs b/crates/blockifier/src/test_utils/l1_handler.rs index 0a95567abb..e6733ea345 100644 --- a/crates/blockifier/src/test_utils/l1_handler.rs +++ b/crates/blockifier/src/test_utils/l1_handler.rs @@ -1,7 +1,8 @@ use starknet_api::calldata; use starknet_api::core::{ContractAddress, Nonce}; use starknet_api::executable_transaction::L1HandlerTransaction; -use starknet_api::transaction::{Fee, TransactionHash, TransactionVersion}; +use starknet_api::transaction::fields::Fee; +use starknet_api::transaction::{TransactionHash, TransactionVersion}; use starknet_types_core::felt::Felt; use crate::abi::abi_utils::selector_from_name; diff --git a/crates/blockifier/src/test_utils/syscall.rs b/crates/blockifier/src/test_utils/syscall.rs index 062bc46372..81db2822d6 100644 --- a/crates/blockifier/src/test_utils/syscall.rs +++ b/crates/blockifier/src/test_utils/syscall.rs @@ -1,5 +1,5 @@ use starknet_api::felt; -use starknet_api::transaction::Calldata; +use starknet_api::transaction::fields::Calldata; use crate::test_utils::{create_calldata, CompilerBasedVersion}; diff --git a/crates/blockifier/src/test_utils/transfers_generator.rs b/crates/blockifier/src/test_utils/transfers_generator.rs index 77f26a6c28..7f48c652d1 100644 --- a/crates/blockifier/src/test_utils/transfers_generator.rs +++ b/crates/blockifier/src/test_utils/transfers_generator.rs @@ -2,7 +2,8 @@ use rand::rngs::StdRng; use rand::{Rng, SeedableRng}; use starknet_api::core::ContractAddress; use starknet_api::test_utils::NonceManager; -use starknet_api::transaction::{Fee, TransactionVersion}; +use starknet_api::transaction::fields::Fee; +use starknet_api::transaction::TransactionVersion; use starknet_api::{calldata, felt, invoke_tx_args}; use starknet_types_core::felt::Felt; diff --git a/crates/blockifier/src/transaction/account_transaction.rs b/crates/blockifier/src/transaction/account_transaction.rs index 09335d4fa2..5a66241926 100644 --- a/crates/blockifier/src/transaction/account_transaction.rs +++ b/crates/blockifier/src/transaction/account_transaction.rs @@ -6,19 +6,18 @@ use starknet_api::calldata; use starknet_api::contract_class::EntryPointType; use starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector, Nonce}; use starknet_api::data_availability::DataAvailabilityMode; -use starknet_api::transaction::Resource::{L1DataGas, L1Gas, L2Gas}; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::Resource::{L1DataGas, L1Gas, L2Gas}; +use starknet_api::transaction::fields::{ AccountDeploymentData, AllResourceBounds, Calldata, Fee, PaymasterData, Tip, - TransactionHash, TransactionSignature, - TransactionVersion, ValidResourceBounds, }; +use starknet_api::transaction::{TransactionHash, TransactionVersion}; use starknet_types_core::felt::Felt; use crate::abi::abi_utils::selector_from_name; diff --git a/crates/blockifier/src/transaction/account_transactions_test.rs b/crates/blockifier/src/transaction/account_transactions_test.rs index 3d39a48b54..3d3bd1ce07 100644 --- a/crates/blockifier/src/transaction/account_transactions_test.rs +++ b/crates/blockifier/src/transaction/account_transactions_test.rs @@ -13,19 +13,17 @@ use starknet_api::hash::StarkHash; use starknet_api::state::StorageKey; use starknet_api::test_utils::invoke::InvokeTxArgs; use starknet_api::test_utils::NonceManager; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AllResourceBounds, Calldata, ContractAddressSalt, - DeclareTransactionV2, Fee, GasVectorComputationMode, Resource, ResourceBounds, - TransactionHash, - TransactionVersion, ValidResourceBounds, }; +use starknet_api::transaction::{DeclareTransactionV2, TransactionHash, TransactionVersion}; use starknet_api::{ calldata, class_hash, diff --git a/crates/blockifier/src/transaction/errors.rs b/crates/blockifier/src/transaction/errors.rs index 180bb9b710..745cdc335a 100644 --- a/crates/blockifier/src/transaction/errors.rs +++ b/crates/blockifier/src/transaction/errors.rs @@ -3,7 +3,8 @@ use num_bigint::BigUint; use starknet_api::block::GasPrice; use starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector, Nonce}; use starknet_api::execution_resources::GasAmount; -use starknet_api::transaction::{AllResourceBounds, Fee, Resource, TransactionVersion}; +use starknet_api::transaction::fields::{AllResourceBounds, Fee, Resource}; +use starknet_api::transaction::TransactionVersion; use starknet_api::StarknetApiError; use starknet_types_core::felt::FromStrError; use thiserror::Error; diff --git a/crates/blockifier/src/transaction/execution_flavors_test.rs b/crates/blockifier/src/transaction/execution_flavors_test.rs index 0e965d44a0..7981df7881 100644 --- a/crates/blockifier/src/transaction/execution_flavors_test.rs +++ b/crates/blockifier/src/transaction/execution_flavors_test.rs @@ -5,15 +5,15 @@ use starknet_api::core::ContractAddress; use starknet_api::execution_resources::{GasAmount, GasVector}; use starknet_api::test_utils::invoke::InvokeTxArgs; use starknet_api::test_utils::NonceManager; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ Calldata, Fee, GasVectorComputationMode, Resource, TransactionSignature, - TransactionVersion, ValidResourceBounds, }; +use starknet_api::transaction::TransactionVersion; use starknet_api::{felt, invoke_tx_args, nonce}; use starknet_types_core::felt::Felt; diff --git a/crates/blockifier/src/transaction/objects.rs b/crates/blockifier/src/transaction/objects.rs index f840991df0..c929fe56f3 100644 --- a/crates/blockifier/src/transaction/objects.rs +++ b/crates/blockifier/src/transaction/objects.rs @@ -5,8 +5,7 @@ use cairo_vm::vm::runners::cairo_runner::ExecutionResources; use starknet_api::core::{ContractAddress, Nonce}; use starknet_api::data_availability::DataAvailabilityMode; use starknet_api::execution_resources::GasVector; -use starknet_api::transaction::{ - signed_tx_version, +use starknet_api::transaction::fields::{ AccountDeploymentData, AllResourceBounds, Fee, @@ -14,11 +13,14 @@ use starknet_api::transaction::{ PaymasterData, ResourceBounds, Tip, + TransactionSignature, + ValidResourceBounds, +}; +use starknet_api::transaction::{ + signed_tx_version, TransactionHash, TransactionOptions, - TransactionSignature, TransactionVersion, - ValidResourceBounds, }; use strum_macros::EnumIter; diff --git a/crates/blockifier/src/transaction/post_execution_test.rs b/crates/blockifier/src/transaction/post_execution_test.rs index 3c7dbf1dee..20fd893a4f 100644 --- a/crates/blockifier/src/transaction/post_execution_test.rs +++ b/crates/blockifier/src/transaction/post_execution_test.rs @@ -3,16 +3,16 @@ use rstest::rstest; use starknet_api::core::ContractAddress; use starknet_api::execution_resources::GasAmount; use starknet_api::state::StorageKey; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AllResourceBounds, Calldata, Fee, GasVectorComputationMode, Resource, ResourceBounds, - TransactionVersion, ValidResourceBounds, }; +use starknet_api::transaction::TransactionVersion; use starknet_api::{contract_address, felt, invoke_tx_args}; use starknet_types_core::felt::Felt; diff --git a/crates/blockifier/src/transaction/test_utils.rs b/crates/blockifier/src/transaction/test_utils.rs index a2934a2206..654ecdb65d 100644 --- a/crates/blockifier/src/transaction/test_utils.rs +++ b/crates/blockifier/src/transaction/test_utils.rs @@ -6,19 +6,21 @@ use starknet_api::execution_resources::GasAmount; use starknet_api::test_utils::deploy_account::DeployAccountTxArgs; use starknet_api::test_utils::invoke::InvokeTxArgs; use starknet_api::test_utils::NonceManager; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AllResourceBounds, ContractAddressSalt, Fee, GasVectorComputationMode, + ResourceBounds, + TransactionSignature, + ValidResourceBounds, +}; +use starknet_api::transaction::{ InvokeTransactionV0, InvokeTransactionV1, InvokeTransactionV3, - ResourceBounds, TransactionHash, - TransactionSignature, TransactionVersion, - ValidResourceBounds, }; use starknet_api::{calldata, declare_tx_args, deploy_account_tx_args, felt, invoke_tx_args}; use starknet_types_core::felt::Felt; diff --git a/crates/blockifier/src/transaction/transaction_execution.rs b/crates/blockifier/src/transaction/transaction_execution.rs index 2b148de9a2..0bbbf36f35 100644 --- a/crates/blockifier/src/transaction/transaction_execution.rs +++ b/crates/blockifier/src/transaction/transaction_execution.rs @@ -3,7 +3,8 @@ use std::sync::Arc; use cairo_vm::vm::runners::cairo_runner::ExecutionResources; use starknet_api::core::{calculate_contract_address, ContractAddress, Nonce}; use starknet_api::executable_transaction::L1HandlerTransaction; -use starknet_api::transaction::{Fee, Transaction as StarknetApiTransaction, TransactionHash}; +use starknet_api::transaction::fields::Fee; +use starknet_api::transaction::{Transaction as StarknetApiTransaction, TransactionHash}; use crate::bouncer::verify_tx_weights_within_max_capacity; use crate::context::BlockContext; diff --git a/crates/blockifier/src/transaction/transactions.rs b/crates/blockifier/src/transaction/transactions.rs index 73ab233cb5..63444009d4 100644 --- a/crates/blockifier/src/transaction/transactions.rs +++ b/crates/blockifier/src/transaction/transactions.rs @@ -9,15 +9,17 @@ use starknet_api::executable_transaction::{ InvokeTransaction as ExecutableInvokeTx, L1HandlerTransaction, }; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AccountDeploymentData, Calldata, ContractAddressSalt, + Fee, + TransactionSignature, +}; +use starknet_api::transaction::{ DeclareTransactionV2, DeclareTransactionV3, - Fee, TransactionHash, - TransactionSignature, TransactionVersion, }; diff --git a/crates/blockifier/src/transaction/transactions_test.rs b/crates/blockifier/src/transaction/transactions_test.rs index 956c228b65..ee59e4f50f 100644 --- a/crates/blockifier/src/transaction/transactions_test.rs +++ b/crates/blockifier/src/transaction/transactions_test.rs @@ -15,21 +15,23 @@ use starknet_api::execution_resources::{GasAmount, GasVector}; use starknet_api::state::StorageKey; use starknet_api::test_utils::invoke::InvokeTxArgs; use starknet_api::test_utils::NonceManager; -use starknet_api::transaction::Resource::{L1DataGas, L1Gas, L2Gas}; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::Resource::{L1DataGas, L1Gas, L2Gas}; +use starknet_api::transaction::fields::{ AllResourceBounds, Calldata, - EventContent, - EventData, - EventKey, Fee, GasVectorComputationMode, - L2ToL1Payload, Resource, ResourceBounds, TransactionSignature, - TransactionVersion, ValidResourceBounds, +}; +use starknet_api::transaction::{ + EventContent, + EventData, + EventKey, + L2ToL1Payload, + TransactionVersion, QUERY_VERSION_BASE_BIT, }; use starknet_api::{ diff --git a/crates/blockifier/src/versioned_constants.rs b/crates/blockifier/src/versioned_constants.rs index a50a696f78..ae3ffe5c1d 100644 --- a/crates/blockifier/src/versioned_constants.rs +++ b/crates/blockifier/src/versioned_constants.rs @@ -17,7 +17,7 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_json::{Map, Number, Value}; use starknet_api::block::{GasPrice, StarknetVersion}; use starknet_api::execution_resources::GasAmount; -use starknet_api::transaction::GasVectorComputationMode; +use starknet_api::transaction::fields::GasVectorComputationMode; use strum::IntoEnumIterator; use thiserror::Error; diff --git a/crates/committer_cli/src/tests/utils/objects.rs b/crates/committer_cli/src/tests/utils/objects.rs index 0f8a2e239c..25bcb4ef6e 100644 --- a/crates/committer_cli/src/tests/utils/objects.rs +++ b/crates/committer_cli/src/tests/utils/objects.rs @@ -13,18 +13,17 @@ use starknet_api::core::{ }; use starknet_api::execution_resources::{GasAmount, GasVector}; use starknet_api::state::{StorageKey, ThinStateDiff}; +use starknet_api::transaction::fields::{Fee, TransactionSignature}; use starknet_api::transaction::{ Event, EventContent, EventData, EventKey, - Fee, L2ToL1Payload, MessageToL1, RevertedTransactionExecutionStatus, TransactionExecutionStatus, TransactionHash, - TransactionSignature, }; use starknet_types_core::felt::Felt; diff --git a/crates/gateway/src/errors.rs b/crates/gateway/src/errors.rs index cb346f7c04..ac36fec878 100644 --- a/crates/gateway/src/errors.rs +++ b/crates/gateway/src/errors.rs @@ -2,7 +2,7 @@ use axum::http::StatusCode; use blockifier::state::errors::StateError; use serde_json::{Error as SerdeError, Value}; use starknet_api::block::GasPrice; -use starknet_api::transaction::{Resource, ResourceBounds}; +use starknet_api::transaction::fields::{Resource, ResourceBounds}; use starknet_api::StarknetApiError; use starknet_gateway_types::errors::GatewaySpecError; use thiserror::Error; diff --git a/crates/gateway/src/state_reader_test_utils.rs b/crates/gateway/src/state_reader_test_utils.rs index d2b33bc6a5..faf1121a53 100644 --- a/crates/gateway/src/state_reader_test_utils.rs +++ b/crates/gateway/src/state_reader_test_utils.rs @@ -10,7 +10,7 @@ use blockifier::test_utils::{CairoVersion, BALANCE}; use starknet_api::block::BlockNumber; use starknet_api::core::{ClassHash, CompiledClassHash, ContractAddress, Nonce}; use starknet_api::state::StorageKey; -use starknet_api::transaction::Fee; +use starknet_api::transaction::fields::Fee; use starknet_types_core::felt::Felt; use crate::state_reader::{MempoolStateReader, StateReaderFactory}; diff --git a/crates/gateway/src/stateful_transaction_validator_test.rs b/crates/gateway/src/stateful_transaction_validator_test.rs index c726b724b3..307d019c46 100644 --- a/crates/gateway/src/stateful_transaction_validator_test.rs +++ b/crates/gateway/src/stateful_transaction_validator_test.rs @@ -22,7 +22,7 @@ use starknet_api::execution_resources::GasAmount; use starknet_api::test_utils::deploy_account::executable_deploy_account_tx; use starknet_api::test_utils::invoke::executable_invoke_tx; use starknet_api::test_utils::NonceManager; -use starknet_api::transaction::Resource; +use starknet_api::transaction::fields::Resource; use starknet_api::{deploy_account_tx_args, invoke_tx_args, nonce}; use starknet_gateway_types::errors::GatewaySpecError; diff --git a/crates/gateway/src/stateless_transaction_validator.rs b/crates/gateway/src/stateless_transaction_validator.rs index ad5191fd1b..9d3e3562d2 100644 --- a/crates/gateway/src/stateless_transaction_validator.rs +++ b/crates/gateway/src/stateless_transaction_validator.rs @@ -7,7 +7,7 @@ use starknet_api::rpc_transaction::{ RpcTransaction, }; use starknet_api::state::EntryPoint; -use starknet_api::transaction::{AllResourceBounds, Resource}; +use starknet_api::transaction::fields::{AllResourceBounds, Resource}; use starknet_types_core::felt::Felt; use tracing::{instrument, Level}; diff --git a/crates/gateway/src/stateless_transaction_validator_test.rs b/crates/gateway/src/stateless_transaction_validator_test.rs index cb7bd2139b..37c20a6717 100644 --- a/crates/gateway/src/stateless_transaction_validator_test.rs +++ b/crates/gateway/src/stateless_transaction_validator_test.rs @@ -14,7 +14,7 @@ use rstest::rstest; use starknet_api::core::{ContractAddress, EntryPointSelector}; use starknet_api::rpc_transaction::{ContractClass, EntryPointByType}; use starknet_api::state::EntryPoint; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AllResourceBounds, Resource, ResourceBounds, diff --git a/crates/mempool/src/mempool.rs b/crates/mempool/src/mempool.rs index ab313810bd..60f46826c7 100644 --- a/crates/mempool/src/mempool.rs +++ b/crates/mempool/src/mempool.rs @@ -3,7 +3,8 @@ use std::collections::HashMap; use starknet_api::block::GasPrice; use starknet_api::core::{ContractAddress, Nonce}; use starknet_api::executable_transaction::AccountTransaction; -use starknet_api::transaction::{Tip, TransactionHash}; +use starknet_api::transaction::fields::Tip; +use starknet_api::transaction::TransactionHash; use starknet_mempool_types::errors::MempoolError; use starknet_mempool_types::mempool_types::{ AccountState, diff --git a/crates/mempool/src/test_utils.rs b/crates/mempool/src/test_utils.rs index 00f72a866d..d495b79c7e 100644 --- a/crates/mempool/src/test_utils.rs +++ b/crates/mempool/src/test_utils.rs @@ -25,13 +25,13 @@ macro_rules! tx { use starknet_api::hash::StarkHash; use starknet_api::invoke_tx_args; use starknet_api::test_utils::invoke::executable_invoke_tx; - use starknet_api::transaction::{ + use starknet_api::transaction::fields::{ AllResourceBounds, ResourceBounds, Tip, - TransactionHash, ValidResourceBounds, }; + use starknet_api::transaction::TransactionHash; let resource_bounds = ValidResourceBounds::AllResources(AllResourceBounds { l2_gas: ResourceBounds { diff --git a/crates/mempool/src/transaction_queue.rs b/crates/mempool/src/transaction_queue.rs index ca7d4c5999..eb51b8ac27 100644 --- a/crates/mempool/src/transaction_queue.rs +++ b/crates/mempool/src/transaction_queue.rs @@ -3,7 +3,8 @@ use std::collections::{BTreeSet, HashMap}; use starknet_api::block::GasPrice; use starknet_api::core::{ContractAddress, Nonce}; -use starknet_api::transaction::{Tip, TransactionHash}; +use starknet_api::transaction::fields::Tip; +use starknet_api::transaction::TransactionHash; use crate::mempool::TransactionReference; diff --git a/crates/mempool_test_utils/src/starknet_api_test_utils.rs b/crates/mempool_test_utils/src/starknet_api_test_utils.rs index dede6d1a5a..5fcb8c093d 100644 --- a/crates/mempool_test_utils/src/starknet_api_test_utils.rs +++ b/crates/mempool_test_utils/src/starknet_api_test_utils.rs @@ -25,7 +25,7 @@ use starknet_api::rpc_transaction::{ use starknet_api::test_utils::deploy_account::DeployAccountTxArgs; use starknet_api::test_utils::invoke::InvokeTxArgs; use starknet_api::test_utils::NonceManager; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AccountDeploymentData, AllResourceBounds, Calldata, @@ -34,9 +34,9 @@ use starknet_api::transaction::{ ResourceBounds, Tip, TransactionSignature, - TransactionVersion, ValidResourceBounds, }; +use starknet_api::transaction::TransactionVersion; use starknet_api::{deploy_account_tx_args, felt, invoke_tx_args, nonce}; use starknet_types_core::felt::Felt; diff --git a/crates/native_blockifier/src/py_block_executor.rs b/crates/native_blockifier/src/py_block_executor.rs index 7bf28040a1..2bbe9fe102 100644 --- a/crates/native_blockifier/src/py_block_executor.rs +++ b/crates/native_blockifier/src/py_block_executor.rs @@ -19,7 +19,7 @@ use serde::Serialize; use starknet_api::block::BlockNumber; use starknet_api::core::{ChainId, ContractAddress}; use starknet_api::execution_resources::GasVector; -use starknet_api::transaction::Fee; +use starknet_api::transaction::fields::Fee; use starknet_types_core::felt::Felt; use crate::errors::{NativeBlockifierError, NativeBlockifierResult}; diff --git a/crates/native_blockifier/src/py_declare.rs b/crates/native_blockifier/src/py_declare.rs index b8d74535f0..6864d58fe1 100644 --- a/crates/native_blockifier/src/py_declare.rs +++ b/crates/native_blockifier/src/py_declare.rs @@ -5,17 +5,19 @@ use blockifier::transaction::transactions::DeclareTransaction; use pyo3::prelude::*; use starknet_api::core::{ClassHash, CompiledClassHash, ContractAddress, Nonce}; use starknet_api::data_availability::DataAvailabilityMode; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AccountDeploymentData, - DeclareTransactionV0V1, - DeclareTransactionV2, - DeclareTransactionV3, Fee, PaymasterData, Tip, - TransactionHash, TransactionSignature, }; +use starknet_api::transaction::{ + DeclareTransactionV0V1, + DeclareTransactionV2, + DeclareTransactionV3, + TransactionHash, +}; use starknet_types_core::felt::Felt; use crate::errors::{NativeBlockifierInputError, NativeBlockifierResult}; diff --git a/crates/native_blockifier/src/py_deploy_account.rs b/crates/native_blockifier/src/py_deploy_account.rs index b25b464103..805400a6cf 100644 --- a/crates/native_blockifier/src/py_deploy_account.rs +++ b/crates/native_blockifier/src/py_deploy_account.rs @@ -5,17 +5,19 @@ use blockifier::transaction::transactions::DeployAccountTransaction; use pyo3::prelude::*; use starknet_api::core::{ClassHash, ContractAddress, Nonce}; use starknet_api::data_availability::DataAvailabilityMode; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ Calldata, ContractAddressSalt, - DeployAccountTransactionV1, - DeployAccountTransactionV3, Fee, PaymasterData, Tip, - TransactionHash, TransactionSignature, }; +use starknet_api::transaction::{ + DeployAccountTransactionV1, + DeployAccountTransactionV3, + TransactionHash, +}; use starknet_types_core::felt::Felt; use crate::errors::{NativeBlockifierInputError, NativeBlockifierResult}; diff --git a/crates/native_blockifier/src/py_invoke_function.rs b/crates/native_blockifier/src/py_invoke_function.rs index 974d0b9b1d..c1d572c22b 100644 --- a/crates/native_blockifier/src/py_invoke_function.rs +++ b/crates/native_blockifier/src/py_invoke_function.rs @@ -6,17 +6,19 @@ use blockifier::transaction::transactions::InvokeTransaction; use pyo3::prelude::*; use starknet_api::core::{ContractAddress, EntryPointSelector, Nonce}; use starknet_api::data_availability::DataAvailabilityMode; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AccountDeploymentData, Calldata, Fee, + PaymasterData, + Tip, + TransactionSignature, +}; +use starknet_api::transaction::{ InvokeTransactionV0, InvokeTransactionV1, InvokeTransactionV3, - PaymasterData, - Tip, TransactionHash, - TransactionSignature, }; use starknet_types_core::felt::Felt; diff --git a/crates/native_blockifier/src/py_l1_handler.rs b/crates/native_blockifier/src/py_l1_handler.rs index 3aa9f33d8e..df90b9642e 100644 --- a/crates/native_blockifier/src/py_l1_handler.rs +++ b/crates/native_blockifier/src/py_l1_handler.rs @@ -4,7 +4,8 @@ use blockifier::abi::constants; use pyo3::prelude::*; use starknet_api::core::{ContractAddress, EntryPointSelector, Nonce}; use starknet_api::executable_transaction::L1HandlerTransaction; -use starknet_api::transaction::{Calldata, Fee, TransactionHash}; +use starknet_api::transaction::fields::{Calldata, Fee}; +use starknet_api::transaction::TransactionHash; use crate::errors::{NativeBlockifierInputError, NativeBlockifierResult}; use crate::py_utils::{from_py_felts, py_attr, PyFelt}; diff --git a/crates/native_blockifier/src/py_transaction.rs b/crates/native_blockifier/src/py_transaction.rs index 5ac4b56df8..e1d6360898 100644 --- a/crates/native_blockifier/src/py_transaction.rs +++ b/crates/native_blockifier/src/py_transaction.rs @@ -9,7 +9,7 @@ use pyo3::prelude::*; use starknet_api::block::GasPrice; use starknet_api::contract_class::ContractClass; use starknet_api::execution_resources::GasAmount; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ DeprecatedResourceBoundsMapping, Resource, ResourceBounds, @@ -33,11 +33,11 @@ pub enum PyResource { L2Gas, } -impl From for starknet_api::transaction::Resource { +impl From for Resource { fn from(py_resource: PyResource) -> Self { match py_resource { - PyResource::L1Gas => starknet_api::transaction::Resource::L1Gas, - PyResource::L2Gas => starknet_api::transaction::Resource::L2Gas, + PyResource::L1Gas => Resource::L1Gas, + PyResource::L2Gas => Resource::L2Gas, } } } @@ -59,7 +59,7 @@ pub struct PyResourceBounds { pub max_price_per_unit: u128, } -impl From for starknet_api::transaction::ResourceBounds { +impl From for ResourceBounds { fn from(py_resource_bounds: PyResourceBounds) -> Self { Self { max_amount: GasAmount(py_resource_bounds.max_amount), diff --git a/crates/papyrus_execution/src/execution_test.rs b/crates/papyrus_execution/src/execution_test.rs index 336a4ea34f..4312181868 100644 --- a/crates/papyrus_execution/src/execution_test.rs +++ b/crates/papyrus_execution/src/execution_test.rs @@ -15,7 +15,7 @@ use pretty_assertions::assert_eq; use starknet_api::block::{BlockNumber, StarknetVersion}; use starknet_api::core::{ChainId, CompiledClassHash, EntryPointSelector}; use starknet_api::state::{StateNumber, ThinStateDiff}; -use starknet_api::transaction::{Calldata, Fee}; +use starknet_api::transaction::fields::{Calldata, Fee}; use starknet_api::{calldata, class_hash, contract_address, felt, nonce}; use starknet_types_core::felt::Felt; diff --git a/crates/papyrus_execution/src/lib.rs b/crates/papyrus_execution/src/lib.rs index 8871d318a3..5b31eb58d6 100644 --- a/crates/papyrus_execution/src/lib.rs +++ b/crates/papyrus_execution/src/lib.rs @@ -59,14 +59,13 @@ use starknet_api::core::{ChainId, ClassHash, ContractAddress, EntryPointSelector use starknet_api::data_availability::L1DataAvailabilityMode; use starknet_api::deprecated_contract_class::ContractClass as DeprecatedContractClass; use starknet_api::state::{StateNumber, ThinStateDiff}; +use starknet_api::transaction::fields::{Calldata, Fee}; use starknet_api::transaction::{ - Calldata, DeclareTransaction, DeclareTransactionV0V1, DeclareTransactionV2, DeclareTransactionV3, DeployAccountTransaction, - Fee, InvokeTransaction, L1HandlerTransaction, Transaction, diff --git a/crates/papyrus_execution/src/objects.rs b/crates/papyrus_execution/src/objects.rs index 860d03e5bb..c51ac800eb 100644 --- a/crates/papyrus_execution/src/objects.rs +++ b/crates/papyrus_execution/src/objects.rs @@ -40,7 +40,8 @@ use starknet_api::execution_resources::{ GasVector as StarknetApiGasVector, }; use starknet_api::state::ThinStateDiff; -use starknet_api::transaction::{Calldata, EventContent, Fee, MessageToL1}; +use starknet_api::transaction::fields::{Calldata, Fee}; +use starknet_api::transaction::{EventContent, MessageToL1}; use starknet_types_core::felt::Felt; use crate::{ExecutionError, ExecutionResult, TransactionExecutionOutput}; diff --git a/crates/papyrus_execution/src/test_utils.rs b/crates/papyrus_execution/src/test_utils.rs index 997ffef715..77152dd5b6 100644 --- a/crates/papyrus_execution/src/test_utils.rs +++ b/crates/papyrus_execution/src/test_utils.rs @@ -32,12 +32,12 @@ use starknet_api::core::{ use starknet_api::deprecated_contract_class::ContractClass as DeprecatedContractClass; use starknet_api::state::{ContractClass, StateNumber, ThinStateDiff}; use starknet_api::test_utils::read_json_file; +use starknet_api::transaction::fields::Fee; use starknet_api::transaction::{ DeclareTransactionV0V1, DeclareTransactionV2, DeployAccountTransaction, DeployAccountTransactionV1, - Fee, InvokeTransaction, InvokeTransactionV1, TransactionHash, diff --git a/crates/papyrus_execution/src/testing_instances.rs b/crates/papyrus_execution/src/testing_instances.rs index ca7376a456..2914ec6d4e 100644 --- a/crates/papyrus_execution/src/testing_instances.rs +++ b/crates/papyrus_execution/src/testing_instances.rs @@ -9,7 +9,8 @@ use starknet_api::contract_address; use starknet_api::contract_class::EntryPointType; use starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector}; use starknet_api::execution_resources::ExecutionResources; -use starknet_api::transaction::{Calldata, EventContent, Fee, MessageToL1}; +use starknet_api::transaction::fields::{Calldata, Fee}; +use starknet_api::transaction::{EventContent, MessageToL1}; use starknet_types_core::felt::Felt; use crate::objects::{ diff --git a/crates/papyrus_protobuf/src/converters/consensus_test.rs b/crates/papyrus_protobuf/src/converters/consensus_test.rs index af6c070c2f..57e328a7fa 100644 --- a/crates/papyrus_protobuf/src/converters/consensus_test.rs +++ b/crates/papyrus_protobuf/src/converters/consensus_test.rs @@ -1,5 +1,6 @@ use papyrus_test_utils::{get_rng, GetTestInstance}; use starknet_api::execution_resources::GasAmount; +use starknet_api::transaction::fields::ValidResourceBounds; use starknet_api::transaction::{ DeclareTransaction, DeclareTransactionV3, @@ -8,7 +9,6 @@ use starknet_api::transaction::{ InvokeTransaction, InvokeTransactionV3, Transaction, - ValidResourceBounds, }; use crate::consensus::{ diff --git a/crates/papyrus_protobuf/src/converters/receipt.rs b/crates/papyrus_protobuf/src/converters/receipt.rs index 052c4bf5e5..1caac6cc1c 100644 --- a/crates/papyrus_protobuf/src/converters/receipt.rs +++ b/crates/papyrus_protobuf/src/converters/receipt.rs @@ -2,11 +2,11 @@ use std::collections::HashMap; use starknet_api::core::{ContractAddress, EthAddress, PatriciaKey}; use starknet_api::execution_resources::{Builtin, ExecutionResources, GasVector}; +use starknet_api::transaction::fields::Fee; use starknet_api::transaction::{ DeclareTransactionOutput, DeployAccountTransactionOutput, DeployTransactionOutput, - Fee, InvokeTransactionOutput, L1HandlerTransactionOutput, L2ToL1Payload, diff --git a/crates/papyrus_protobuf/src/converters/rpc_transaction.rs b/crates/papyrus_protobuf/src/converters/rpc_transaction.rs index 292e706736..234a31e3ff 100644 --- a/crates/papyrus_protobuf/src/converters/rpc_transaction.rs +++ b/crates/papyrus_protobuf/src/converters/rpc_transaction.rs @@ -15,12 +15,11 @@ use starknet_api::rpc_transaction::{ RpcTransaction, }; use starknet_api::state::EntryPoint; +use starknet_api::transaction::fields::{AllResourceBounds, ValidResourceBounds}; use starknet_api::transaction::{ - AllResourceBounds, DeclareTransactionV3, DeployAccountTransactionV3, InvokeTransactionV3, - ValidResourceBounds, }; use starknet_types_core::felt::Felt; diff --git a/crates/papyrus_protobuf/src/converters/rpc_transaction_test.rs b/crates/papyrus_protobuf/src/converters/rpc_transaction_test.rs index 7984e4dd5f..081cbf1910 100644 --- a/crates/papyrus_protobuf/src/converters/rpc_transaction_test.rs +++ b/crates/papyrus_protobuf/src/converters/rpc_transaction_test.rs @@ -11,7 +11,7 @@ use starknet_api::rpc_transaction::{ RpcInvokeTransactionV3, RpcTransaction, }; -use starknet_api::transaction::{AllResourceBounds, ResourceBounds}; +use starknet_api::transaction::fields::{AllResourceBounds, ResourceBounds}; use crate::mempool::RpcTransactionWrapper; diff --git a/crates/papyrus_protobuf/src/converters/transaction.rs b/crates/papyrus_protobuf/src/converters/transaction.rs index 81aaf05444..2e43b8ccf6 100644 --- a/crates/papyrus_protobuf/src/converters/transaction.rs +++ b/crates/papyrus_protobuf/src/converters/transaction.rs @@ -7,11 +7,19 @@ use prost::Message; use starknet_api::block::GasPrice; use starknet_api::core::{ClassHash, CompiledClassHash, EntryPointSelector, Nonce}; use starknet_api::execution_resources::GasAmount; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AccountDeploymentData, AllResourceBounds, Calldata, ContractAddressSalt, + Fee, + PaymasterData, + ResourceBounds, + Tip, + TransactionSignature, + ValidResourceBounds, +}; +use starknet_api::transaction::{ DeclareTransaction, DeclareTransactionV0V1, DeclareTransactionV2, @@ -20,22 +28,16 @@ use starknet_api::transaction::{ DeployAccountTransactionV1, DeployAccountTransactionV3, DeployTransaction, - Fee, FullTransaction, InvokeTransaction, InvokeTransactionV0, InvokeTransactionV1, InvokeTransactionV3, L1HandlerTransaction, - PaymasterData, - ResourceBounds, - Tip, Transaction, TransactionHash, TransactionOutput, - TransactionSignature, TransactionVersion, - ValidResourceBounds, }; use starknet_types_core::felt::Felt; diff --git a/crates/papyrus_protobuf/src/converters/transaction_test.rs b/crates/papyrus_protobuf/src/converters/transaction_test.rs index 7134299385..ce5d02eabe 100644 --- a/crates/papyrus_protobuf/src/converters/transaction_test.rs +++ b/crates/papyrus_protobuf/src/converters/transaction_test.rs @@ -3,8 +3,8 @@ use papyrus_test_utils::{get_rng, GetTestInstance}; use rand::random; use starknet_api::block::GasPrice; use starknet_api::execution_resources::{Builtin, ExecutionResources, GasAmount, GasVector}; +use starknet_api::transaction::fields::{AllResourceBounds, ResourceBounds, ValidResourceBounds}; use starknet_api::transaction::{ - AllResourceBounds, DeclareTransaction, DeclareTransactionOutput, DeployAccountTransaction, @@ -14,11 +14,9 @@ use starknet_api::transaction::{ InvokeTransaction, InvokeTransactionOutput, L1HandlerTransactionOutput, - ResourceBounds, Transaction as StarknetApiTransaction, TransactionHash, TransactionOutput, - ValidResourceBounds, }; use starknet_types_core::felt::Felt; diff --git a/crates/papyrus_rpc/src/api.rs b/crates/papyrus_rpc/src/api.rs index c6049e1288..476548b574 100644 --- a/crates/papyrus_rpc/src/api.rs +++ b/crates/papyrus_rpc/src/api.rs @@ -7,7 +7,7 @@ use papyrus_storage::StorageReader; use serde::{Deserialize, Serialize}; use starknet_api::block::{BlockHash, BlockHashAndNumber, BlockNumber}; use starknet_api::core::{ChainId, ContractAddress, EntryPointSelector}; -use starknet_api::transaction::Calldata; +use starknet_api::transaction::fields::Calldata; use starknet_client::reader::PendingData; use starknet_client::writer::StarknetWriter; use tokio::sync::RwLock; diff --git a/crates/papyrus_rpc/src/v0_8/api/api_impl.rs b/crates/papyrus_rpc/src/v0_8/api/api_impl.rs index 0d235d1c23..b05437de3d 100644 --- a/crates/papyrus_rpc/src/v0_8/api/api_impl.rs +++ b/crates/papyrus_rpc/src/v0_8/api/api_impl.rs @@ -32,10 +32,10 @@ use starknet_api::core::{ use starknet_api::execution_utils::format_panic_data; use starknet_api::hash::StarkHash; use starknet_api::state::{StateNumber, StorageKey}; +use starknet_api::transaction::fields::Fee; use starknet_api::transaction::{ EventContent, EventIndexInTransactionOutput, - Fee, Transaction as StarknetApiTransaction, TransactionHash, TransactionOffsetInBlock, diff --git a/crates/papyrus_rpc/src/v0_8/api/mod.rs b/crates/papyrus_rpc/src/v0_8/api/mod.rs index b264c1b6f6..0c272fc379 100644 --- a/crates/papyrus_rpc/src/v0_8/api/mod.rs +++ b/crates/papyrus_rpc/src/v0_8/api/mod.rs @@ -24,7 +24,8 @@ use starknet_api::deprecated_contract_class::{ Program, }; use starknet_api::state::{StateNumber, StorageKey}; -use starknet_api::transaction::{EventKey, Fee, TransactionHash, TransactionOffsetInBlock}; +use starknet_api::transaction::fields::Fee; +use starknet_api::transaction::{EventKey, TransactionHash, TransactionOffsetInBlock}; use starknet_types_core::felt::Felt; use tracing::debug; diff --git a/crates/papyrus_rpc/src/v0_8/broadcasted_transaction.rs b/crates/papyrus_rpc/src/v0_8/broadcasted_transaction.rs index e5e13ad653..0d802e3272 100644 --- a/crates/papyrus_rpc/src/v0_8/broadcasted_transaction.rs +++ b/crates/papyrus_rpc/src/v0_8/broadcasted_transaction.rs @@ -15,14 +15,14 @@ use papyrus_storage::db::serialization::StorageSerdeError; use serde::{Deserialize, Serialize}; use starknet_api::core::{CompiledClassHash, ContractAddress, Nonce}; use starknet_api::data_availability::DataAvailabilityMode; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AccountDeploymentData, Fee, PaymasterData, Tip, TransactionSignature, - TransactionVersion, }; +use starknet_api::transaction::TransactionVersion; use starknet_client::writer::objects::transaction as client_transaction; use starknet_client::writer::objects::transaction::DeprecatedContractClass; diff --git a/crates/papyrus_rpc/src/v0_8/broadcasted_transaction_test.rs b/crates/papyrus_rpc/src/v0_8/broadcasted_transaction_test.rs index 6d89b0a49b..806581ba01 100644 --- a/crates/papyrus_rpc/src/v0_8/broadcasted_transaction_test.rs +++ b/crates/papyrus_rpc/src/v0_8/broadcasted_transaction_test.rs @@ -19,7 +19,7 @@ use starknet_api::deprecated_contract_class::{ StructAbiEntry, }; use starknet_api::state::EntryPoint; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AccountDeploymentData, Fee, PaymasterData, diff --git a/crates/papyrus_rpc/src/v0_8/execution_test.rs b/crates/papyrus_rpc/src/v0_8/execution_test.rs index cbf13ce191..0313f85656 100644 --- a/crates/papyrus_rpc/src/v0_8/execution_test.rs +++ b/crates/papyrus_rpc/src/v0_8/execution_test.rs @@ -66,9 +66,8 @@ use starknet_api::deprecated_contract_class::ContractClass as SN_API_DeprecatedC use starknet_api::hash::StarkHash; use starknet_api::state::{StorageKey, ThinStateDiff as StarknetApiStateDiff}; use starknet_api::test_utils::read_json_file; +use starknet_api::transaction::fields::{Calldata, Fee}; use starknet_api::transaction::{ - Calldata, - Fee, L1HandlerTransaction, TransactionHash, TransactionOffsetInBlock, diff --git a/crates/papyrus_rpc/src/v0_8/transaction.rs b/crates/papyrus_rpc/src/v0_8/transaction.rs index b7cfaee459..1637542041 100644 --- a/crates/papyrus_rpc/src/v0_8/transaction.rs +++ b/crates/papyrus_rpc/src/v0_8/transaction.rs @@ -27,22 +27,24 @@ use starknet_api::core::{ use starknet_api::data_availability::DataAvailabilityMode; use starknet_api::execution_resources::GasAmount; use starknet_api::serde_utils::bytes_from_hex_str; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AccountDeploymentData, AllResourceBounds, Calldata, ContractAddressSalt, - DeployTransaction, Fee, - L1HandlerTransaction, - MessageToL1, PaymasterData, Resource, ResourceBounds, Tip, + TransactionSignature, +}; +use starknet_api::transaction::{ + DeployTransaction, + L1HandlerTransaction, + MessageToL1, TransactionExecutionStatus, TransactionHash, - TransactionSignature, TransactionVersion, }; use starknet_client::writer::objects::transaction as client_transaction; @@ -155,14 +157,18 @@ pub struct ResourceBoundsMapping { pub l2_gas: ResourceBounds, } -impl From for starknet_api::transaction::DeprecatedResourceBoundsMapping { +impl From + for starknet_api::transaction::fields::DeprecatedResourceBoundsMapping +{ fn from(value: ResourceBoundsMapping) -> Self { Self([(Resource::L1Gas, value.l1_gas), (Resource::L2Gas, value.l2_gas)].into()) } } -impl From for ResourceBoundsMapping { - fn from(value: starknet_api::transaction::DeprecatedResourceBoundsMapping) -> Self { +impl From + for ResourceBoundsMapping +{ + fn from(value: starknet_api::transaction::fields::DeprecatedResourceBoundsMapping) -> Self { Self { l1_gas: value.0.get(&Resource::L1Gas).cloned().unwrap_or_default(), l2_gas: value.0.get(&Resource::L2Gas).cloned().unwrap_or_default(), @@ -170,7 +176,7 @@ impl From for Resour } } -impl TryFrom for starknet_api::transaction::ValidResourceBounds { +impl TryFrom for starknet_api::transaction::fields::ValidResourceBounds { type Error = ErrorObjectOwned; fn try_from(value: ResourceBoundsMapping) -> Result { if !value.l2_gas.is_zero() { @@ -181,17 +187,15 @@ impl TryFrom for starknet_api::transaction::ValidResource } } -impl From for ResourceBoundsMapping { - fn from(value: starknet_api::transaction::ValidResourceBounds) -> Self { +impl From for ResourceBoundsMapping { + fn from(value: starknet_api::transaction::fields::ValidResourceBounds) -> Self { match value { - starknet_api::transaction::ValidResourceBounds::L1Gas(l1_gas) => { + starknet_api::transaction::fields::ValidResourceBounds::L1Gas(l1_gas) => { Self { l1_gas, l2_gas: ResourceBounds::default() } } - starknet_api::transaction::ValidResourceBounds::AllResources(AllResourceBounds { - l1_gas, - l2_gas, - .. - }) => Self { l1_gas, l2_gas }, + starknet_api::transaction::fields::ValidResourceBounds::AllResources( + AllResourceBounds { l1_gas, l2_gas, .. }, + ) => Self { l1_gas, l2_gas }, } } } diff --git a/crates/papyrus_rpc/src/v0_8/transaction_test.rs b/crates/papyrus_rpc/src/v0_8/transaction_test.rs index d214a433ac..965656b6f8 100644 --- a/crates/papyrus_rpc/src/v0_8/transaction_test.rs +++ b/crates/papyrus_rpc/src/v0_8/transaction_test.rs @@ -7,18 +7,16 @@ use papyrus_test_utils::{ use pretty_assertions::assert_eq; use starknet_api::core::{ClassHash, ContractAddress, EntryPointSelector, Nonce}; use starknet_api::data_availability::DataAvailabilityMode; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AccountDeploymentData, Calldata, ContractAddressSalt, Fee, - L1HandlerTransaction, PaymasterData, Tip, - Transaction, TransactionSignature, - TransactionVersion, }; +use starknet_api::transaction::{L1HandlerTransaction, Transaction, TransactionVersion}; use starknet_api::{calldata, contract_address, felt, nonce}; use starknet_client::writer::objects::transaction as client_transaction; diff --git a/crates/papyrus_rpc/tests/gateway_integration_test.rs b/crates/papyrus_rpc/tests/gateway_integration_test.rs index 478e270e64..a4e24cb698 100644 --- a/crates/papyrus_rpc/tests/gateway_integration_test.rs +++ b/crates/papyrus_rpc/tests/gateway_integration_test.rs @@ -10,7 +10,8 @@ use papyrus_rpc::{ TransactionVersion1RPC0_8, }; use starknet_api::core::{ChainId, ContractAddress, EntryPointSelector, Nonce}; -use starknet_api::transaction::{Fee, Transaction, TransactionOptions, TransactionSignature}; +use starknet_api::transaction::fields::{Fee, TransactionSignature}; +use starknet_api::transaction::{Transaction, TransactionOptions}; use starknet_api::transaction_hash::get_transaction_hash; use starknet_api::{calldata, contract_address, felt}; use starknet_client::writer::objects::transaction::InvokeTransaction as SNClientInvokeTransaction; diff --git a/crates/papyrus_storage/src/serialization/serializers.rs b/crates/papyrus_storage/src/serialization/serializers.rs index a3e4306bb3..972b5769b3 100644 --- a/crates/papyrus_storage/src/serialization/serializers.rs +++ b/crates/papyrus_storage/src/serialization/serializers.rs @@ -67,11 +67,20 @@ use starknet_api::deprecated_contract_class::{ use starknet_api::execution_resources::{Builtin, ExecutionResources, GasAmount, GasVector}; use starknet_api::hash::{PoseidonHash, StarkHash}; use starknet_api::state::{ContractClass, EntryPoint, FunctionIndex, StorageKey, ThinStateDiff}; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AccountDeploymentData, AllResourceBounds, Calldata, ContractAddressSalt, + Fee, + PaymasterData, + Resource, + ResourceBounds, + Tip, + TransactionSignature, + ValidResourceBounds, +}; +use starknet_api::transaction::{ DeclareTransaction, DeclareTransactionOutput, DeclareTransactionV0V1, @@ -88,7 +97,6 @@ use starknet_api::transaction::{ EventData, EventIndexInTransactionOutput, EventKey, - Fee, InvokeTransaction, InvokeTransactionOutput, InvokeTransactionV0, @@ -100,19 +108,13 @@ use starknet_api::transaction::{ L2ToL1Payload, MessageToL1, MessageToL2, - PaymasterData, - Resource, - ResourceBounds, RevertedTransactionExecutionStatus, - Tip, Transaction, TransactionExecutionStatus, TransactionHash, TransactionOffsetInBlock, TransactionOutput, - TransactionSignature, TransactionVersion, - ValidResourceBounds, }; use starknet_types_core::felt::Felt; use tracing::warn; diff --git a/crates/papyrus_test_utils/src/lib.rs b/crates/papyrus_test_utils/src/lib.rs index a207aa94e3..fb91537eec 100644 --- a/crates/papyrus_test_utils/src/lib.rs +++ b/crates/papyrus_test_utils/src/lib.rs @@ -108,11 +108,20 @@ use starknet_api::state::{ ThinStateDiff, }; use starknet_api::test_utils::read_json_file; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AccountDeploymentData, AllResourceBounds, Calldata, ContractAddressSalt, + Fee, + PaymasterData, + Resource, + ResourceBounds, + Tip, + TransactionSignature, + ValidResourceBounds, +}; +use starknet_api::transaction::{ DeclareTransaction, DeclareTransactionOutput, DeclareTransactionV0V1, @@ -129,7 +138,6 @@ use starknet_api::transaction::{ EventData, EventIndexInTransactionOutput, EventKey, - Fee, InvokeTransaction, InvokeTransactionOutput, InvokeTransactionV0, @@ -141,19 +149,13 @@ use starknet_api::transaction::{ L2ToL1Payload, MessageToL1, MessageToL2, - PaymasterData, - Resource, - ResourceBounds, RevertedTransactionExecutionStatus, - Tip, Transaction, TransactionExecutionStatus, TransactionHash, TransactionOffsetInBlock, TransactionOutput, - TransactionSignature, TransactionVersion, - ValidResourceBounds, }; use starknet_types_core::felt::Felt; diff --git a/crates/starknet_api/src/block.rs b/crates/starknet_api/src/block.rs index 09bee68117..32dde80eac 100644 --- a/crates/starknet_api/src/block.rs +++ b/crates/starknet_api/src/block.rs @@ -21,7 +21,8 @@ use crate::data_availability::L1DataAvailabilityMode; use crate::execution_resources::GasAmount; use crate::hash::StarkHash; use crate::serde_utils::{BytesAsHex, PrefixedBytesAsHex}; -use crate::transaction::{Fee, Transaction, TransactionHash, TransactionOutput}; +use crate::transaction::fields::Fee; +use crate::transaction::{Transaction, TransactionHash, TransactionOutput}; use crate::StarknetApiError; /// A block. diff --git a/crates/starknet_api/src/block_hash/block_hash_calculator.rs b/crates/starknet_api/src/block_hash/block_hash_calculator.rs index ad367ba847..e948bd4b39 100644 --- a/crates/starknet_api/src/block_hash/block_hash_calculator.rs +++ b/crates/starknet_api/src/block_hash/block_hash_calculator.rs @@ -20,14 +20,8 @@ use crate::crypto::utils::HashChain; use crate::data_availability::L1DataAvailabilityMode; use crate::execution_resources::GasVector; use crate::state::ThinStateDiff; -use crate::transaction::{ - Event, - Fee, - MessageToL1, - TransactionExecutionStatus, - TransactionHash, - TransactionSignature, -}; +use crate::transaction::fields::{Fee, TransactionSignature}; +use crate::transaction::{Event, MessageToL1, TransactionExecutionStatus, TransactionHash}; use crate::{StarknetApiError, StarknetApiResult}; #[cfg(test)] diff --git a/crates/starknet_api/src/block_hash/block_hash_calculator_test.rs b/crates/starknet_api/src/block_hash/block_hash_calculator_test.rs index 9981acf2c2..7adb1ad094 100644 --- a/crates/starknet_api/src/block_hash/block_hash_calculator_test.rs +++ b/crates/starknet_api/src/block_hash/block_hash_calculator_test.rs @@ -30,7 +30,8 @@ use crate::core::{ use crate::data_availability::L1DataAvailabilityMode; use crate::felt; use crate::hash::PoseidonHash; -use crate::transaction::{TransactionHash, TransactionSignature}; +use crate::transaction::fields::TransactionSignature; +use crate::transaction::TransactionHash; /// Macro to test if changing any field in the header or commitments /// results a change in the block hash. diff --git a/crates/starknet_api/src/block_hash/test_utils.rs b/crates/starknet_api/src/block_hash/test_utils.rs index 08bd00af94..620a8e5210 100644 --- a/crates/starknet_api/src/block_hash/test_utils.rs +++ b/crates/starknet_api/src/block_hash/test_utils.rs @@ -6,8 +6,8 @@ use super::block_hash_calculator::TransactionOutputForHash; use crate::core::{ClassHash, CompiledClassHash, ContractAddress, EthAddress, Nonce}; use crate::execution_resources::{GasAmount, GasVector}; use crate::state::ThinStateDiff; +use crate::transaction::fields::Fee; use crate::transaction::{ - Fee, L2ToL1Payload, MessageToL1, RevertedTransactionExecutionStatus, diff --git a/crates/starknet_api/src/block_hash/transaction_commitment.rs b/crates/starknet_api/src/block_hash/transaction_commitment.rs index 93d23f31a8..9ddb4ad901 100644 --- a/crates/starknet_api/src/block_hash/transaction_commitment.rs +++ b/crates/starknet_api/src/block_hash/transaction_commitment.rs @@ -5,7 +5,8 @@ use super::block_hash_calculator::TransactionHashingData; use crate::core::TransactionCommitment; use crate::crypto::patricia_hash::calculate_root; use crate::crypto::utils::HashChain; -use crate::transaction::{TransactionHash, TransactionSignature}; +use crate::transaction::fields::TransactionSignature; +use crate::transaction::TransactionHash; #[cfg(test)] #[path = "transaction_commitment_test.rs"] diff --git a/crates/starknet_api/src/block_hash/transaction_commitment_test.rs b/crates/starknet_api/src/block_hash/transaction_commitment_test.rs index bc0d51bb99..a8287d28c1 100644 --- a/crates/starknet_api/src/block_hash/transaction_commitment_test.rs +++ b/crates/starknet_api/src/block_hash/transaction_commitment_test.rs @@ -8,7 +8,8 @@ use crate::block_hash::transaction_commitment::{ }; use crate::core::TransactionCommitment; use crate::felt; -use crate::transaction::{TransactionHash, TransactionSignature}; +use crate::transaction::fields::TransactionSignature; +use crate::transaction::TransactionHash; #[test] fn test_transaction_leaf_regression() { diff --git a/crates/starknet_api/src/core.rs b/crates/starknet_api/src/core.rs index 8296075c8d..ec2ac3ed8e 100644 --- a/crates/starknet_api/src/core.rs +++ b/crates/starknet_api/src/core.rs @@ -13,7 +13,7 @@ use starknet_types_core::hash::{Pedersen, StarkHash as CoreStarkHash}; use crate::crypto::utils::PublicKey; use crate::hash::{PoseidonHash, StarkHash}; use crate::serde_utils::{BytesAsHex, PrefixedBytesAsHex}; -use crate::transaction::{Calldata, ContractAddressSalt}; +use crate::transaction::fields::{Calldata, ContractAddressSalt}; use crate::{impl_from_through_intermediate, StarknetApiError}; /// Felt. diff --git a/crates/starknet_api/src/core_test.rs b/crates/starknet_api/src/core_test.rs index 0077823bda..81221cce44 100644 --- a/crates/starknet_api/src/core_test.rs +++ b/crates/starknet_api/src/core_test.rs @@ -15,7 +15,7 @@ use crate::core::{ L2_ADDRESS_UPPER_BOUND, }; use crate::hash::StarkHash; -use crate::transaction::{Calldata, ContractAddressSalt}; +use crate::transaction::fields::{Calldata, ContractAddressSalt}; use crate::{class_hash, felt, patricia_key}; #[test] diff --git a/crates/starknet_api/src/executable_transaction.rs b/crates/starknet_api/src/executable_transaction.rs index f94e668d12..dac7c337b7 100644 --- a/crates/starknet_api/src/executable_transaction.rs +++ b/crates/starknet_api/src/executable_transaction.rs @@ -9,7 +9,7 @@ use crate::rpc_transaction::{ RpcInvokeTransaction, RpcInvokeTransactionV3, }; -use crate::transaction::{ +use crate::transaction::fields::{ AccountDeploymentData, AllResourceBounds, Calldata, @@ -17,12 +17,10 @@ use crate::transaction::{ Fee, PaymasterData, Tip, - TransactionHash, - TransactionHasher, TransactionSignature, - TransactionVersion, ValidResourceBounds, }; +use crate::transaction::{TransactionHash, TransactionHasher, TransactionVersion}; use crate::StarknetApiError; macro_rules! implement_inner_tx_getter_calls { diff --git a/crates/starknet_api/src/execution_resources.rs b/crates/starknet_api/src/execution_resources.rs index 6f9868048c..9c56443464 100644 --- a/crates/starknet_api/src/execution_resources.rs +++ b/crates/starknet_api/src/execution_resources.rs @@ -5,7 +5,7 @@ use starknet_types_core::felt::Felt; use strum_macros::EnumIter; use crate::block::{GasPrice, GasPriceVector, NonzeroGasPrice}; -use crate::transaction::{Fee, Resource}; +use crate::transaction::fields::{Fee, Resource}; #[cfg_attr( any(test, feature = "testing"), diff --git a/crates/starknet_api/src/rpc_transaction.rs b/crates/starknet_api/src/rpc_transaction.rs index d489835db3..7c47f15c9a 100644 --- a/crates/starknet_api/src/rpc_transaction.rs +++ b/crates/starknet_api/src/rpc_transaction.rs @@ -14,22 +14,24 @@ use crate::core::{ }; use crate::data_availability::DataAvailabilityMode; use crate::state::EntryPoint; -use crate::transaction::{ +use crate::transaction::fields::{ AccountDeploymentData, AllResourceBounds, Calldata, ContractAddressSalt, + PaymasterData, + Tip, + TransactionSignature, + ValidResourceBounds, +}; +use crate::transaction::{ DeclareTransaction, DeclareTransactionV3, DeployAccountTransaction, DeployAccountTransactionV3, InvokeTransaction, InvokeTransactionV3, - PaymasterData, - Tip, Transaction, - TransactionSignature, - ValidResourceBounds, }; use crate::StarknetApiError; diff --git a/crates/starknet_api/src/rpc_transaction_test.rs b/crates/starknet_api/src/rpc_transaction_test.rs index b3face276c..cedc4f2fa0 100644 --- a/crates/starknet_api/src/rpc_transaction_test.rs +++ b/crates/starknet_api/src/rpc_transaction_test.rs @@ -17,7 +17,7 @@ use crate::rpc_transaction::{ RpcInvokeTransactionV3, RpcTransaction, }; -use crate::transaction::{ +use crate::transaction::fields::{ AccountDeploymentData, AllResourceBounds, Calldata, diff --git a/crates/starknet_api/src/test_utils/declare.rs b/crates/starknet_api/src/test_utils/declare.rs index 33a4ba223a..212b0f642f 100644 --- a/crates/starknet_api/src/test_utils/declare.rs +++ b/crates/starknet_api/src/test_utils/declare.rs @@ -2,19 +2,21 @@ use crate::contract_class::ClassInfo; use crate::core::{ClassHash, CompiledClassHash, ContractAddress, Nonce}; use crate::data_availability::DataAvailabilityMode; use crate::executable_transaction::DeclareTransaction as ExecutableDeclareTransaction; -use crate::transaction::{ +use crate::transaction::fields::{ AccountDeploymentData, + Fee, + PaymasterData, + Tip, + TransactionSignature, + ValidResourceBounds, +}; +use crate::transaction::{ DeclareTransaction, DeclareTransactionV0V1, DeclareTransactionV2, DeclareTransactionV3, - Fee, - PaymasterData, - Tip, TransactionHash, - TransactionSignature, TransactionVersion, - ValidResourceBounds, }; #[derive(Clone)] diff --git a/crates/starknet_api/src/test_utils/deploy_account.rs b/crates/starknet_api/src/test_utils/deploy_account.rs index a9b3093bb7..726c74ba8f 100644 --- a/crates/starknet_api/src/test_utils/deploy_account.rs +++ b/crates/starknet_api/src/test_utils/deploy_account.rs @@ -2,20 +2,22 @@ use super::NonceManager; use crate::core::{calculate_contract_address, ClassHash, ContractAddress, Nonce}; use crate::data_availability::DataAvailabilityMode; use crate::executable_transaction::DeployAccountTransaction as ExecutableDeployAccountTransaction; -use crate::transaction::{ +use crate::transaction::fields::{ Calldata, ContractAddressSalt, - DeployAccountTransaction, - DeployAccountTransactionV1, - DeployAccountTransactionV3, Fee, PaymasterData, Tip, - TransactionHash, TransactionSignature, - TransactionVersion, ValidResourceBounds, }; +use crate::transaction::{ + DeployAccountTransaction, + DeployAccountTransactionV1, + DeployAccountTransactionV3, + TransactionHash, + TransactionVersion, +}; #[derive(Clone)] pub struct DeployAccountTxArgs { diff --git a/crates/starknet_api/src/test_utils/invoke.rs b/crates/starknet_api/src/test_utils/invoke.rs index 4340253557..e8cec7c1b4 100644 --- a/crates/starknet_api/src/test_utils/invoke.rs +++ b/crates/starknet_api/src/test_utils/invoke.rs @@ -2,19 +2,21 @@ use crate::calldata; use crate::core::{ContractAddress, Nonce}; use crate::data_availability::DataAvailabilityMode; use crate::executable_transaction::InvokeTransaction as ExecutableInvokeTransaction; -use crate::transaction::{ +use crate::transaction::fields::{ AccountDeploymentData, Calldata, Fee, + PaymasterData, + Tip, + TransactionSignature, + ValidResourceBounds, +}; +use crate::transaction::{ InvokeTransaction, InvokeTransactionV1, InvokeTransactionV3, - PaymasterData, - Tip, TransactionHash, - TransactionSignature, TransactionVersion, - ValidResourceBounds, }; #[derive(Clone)] diff --git a/crates/starknet_api/src/transaction.rs b/crates/starknet_api/src/transaction.rs index 7764db0646..f343c8b477 100644 --- a/crates/starknet_api/src/transaction.rs +++ b/crates/starknet_api/src/transaction.rs @@ -15,18 +15,12 @@ use crate::core::{ use crate::data_availability::DataAvailabilityMode; use crate::execution_resources::ExecutionResources; use crate::hash::StarkHash; -// TODO(Arni): Remove the use of pub use. -pub use crate::transaction::fields::{ +use crate::transaction::fields::{ AccountDeploymentData, - AllResourceBounds, Calldata, ContractAddressSalt, - DeprecatedResourceBoundsMapping, Fee, - GasVectorComputationMode, PaymasterData, - Resource, - ResourceBounds, Tip, TransactionSignature, ValidResourceBounds, diff --git a/crates/starknet_api/src/transaction_hash.rs b/crates/starknet_api/src/transaction_hash.rs index b6b0d98c6f..6f578c3305 100644 --- a/crates/starknet_api/src/transaction_hash.rs +++ b/crates/starknet_api/src/transaction_hash.rs @@ -6,6 +6,7 @@ use crate::block::BlockNumber; use crate::core::{ascii_as_felt, calculate_contract_address, ChainId, ContractAddress}; use crate::crypto::utils::HashChain; use crate::data_availability::DataAvailabilityMode; +use crate::transaction::fields::{ResourceBounds, Tip, ValidResourceBounds}; use crate::transaction::{ signed_tx_version_from_tx, DeclareTransaction, @@ -21,13 +22,10 @@ use crate::transaction::{ InvokeTransactionV1, InvokeTransactionV3, L1HandlerTransaction, - ResourceBounds, - Tip, Transaction, TransactionHash, TransactionOptions, TransactionVersion, - ValidResourceBounds, }; use crate::StarknetApiError; diff --git a/crates/starknet_client/src/reader/objects/test_utils.rs b/crates/starknet_client/src/reader/objects/test_utils.rs index 130aa84d3b..ffb55966f8 100644 --- a/crates/starknet_client/src/reader/objects/test_utils.rs +++ b/crates/starknet_client/src/reader/objects/test_utils.rs @@ -13,21 +13,23 @@ use starknet_api::core::{ use starknet_api::execution_resources::GasVector; use starknet_api::hash::StarkHash; use starknet_api::state::EntryPoint; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AccountDeploymentData, Calldata, ContractAddressSalt, - Event, Fee, - L1ToL2Payload, - L2ToL1Payload, PaymasterData, Tip, + TransactionSignature, + ValidResourceBounds, +}; +use starknet_api::transaction::{ + Event, + L1ToL2Payload, + L2ToL1Payload, TransactionHash, TransactionOffsetInBlock, - TransactionSignature, TransactionVersion, - ValidResourceBounds, }; use starknet_types_core::felt::Felt; diff --git a/crates/starknet_client/src/reader/objects/transaction.rs b/crates/starknet_client/src/reader/objects/transaction.rs index aa1cdd5f37..e341c2ea20 100644 --- a/crates/starknet_client/src/reader/objects/transaction.rs +++ b/crates/starknet_client/src/reader/objects/transaction.rs @@ -16,30 +16,32 @@ use starknet_api::core::{ }; use starknet_api::execution_resources::{GasAmount, GasVector}; use starknet_api::hash::StarkHash; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AccountDeploymentData, Calldata, ContractAddressSalt, + Fee, + PaymasterData, + Tip, + TransactionSignature, + ValidResourceBounds, +}; +use starknet_api::transaction::{ DeclareTransactionOutput, DeployAccountTransactionOutput, DeployTransactionOutput, Event, - Fee, InvokeTransactionOutput, L1HandlerTransactionOutput, L1ToL2Payload, L2ToL1Payload, MessageToL1, - PaymasterData, RevertedTransactionExecutionStatus as SnApiRevertedTransactionExecutionStatus, - Tip, TransactionExecutionStatus as SnApiTransactionExecutionStatus, TransactionHash, TransactionOffsetInBlock, TransactionOutput, - TransactionSignature, TransactionVersion, - ValidResourceBounds, }; use strum_macros::EnumIter; use tracing::error; diff --git a/crates/starknet_client/src/reader/starknet_feeder_gateway_client_test.rs b/crates/starknet_client/src/reader/starknet_feeder_gateway_client_test.rs index 8a5f93ca58..a2cf5cf262 100644 --- a/crates/starknet_client/src/reader/starknet_feeder_gateway_client_test.rs +++ b/crates/starknet_client/src/reader/starknet_feeder_gateway_client_test.rs @@ -22,7 +22,8 @@ use starknet_api::deprecated_contract_class::{ TypedParameter, }; use starknet_api::state::{EntryPoint, FunctionIndex}; -use starknet_api::transaction::{Fee, TransactionHash, TransactionSignature, TransactionVersion}; +use starknet_api::transaction::fields::{Fee, TransactionSignature}; +use starknet_api::transaction::{TransactionHash, TransactionVersion}; use starknet_api::{class_hash, contract_address, felt, nonce}; use super::objects::state::StateUpdate; diff --git a/crates/starknet_client/src/writer/objects/transaction.rs b/crates/starknet_client/src/writer/objects/transaction.rs index d7feec2193..3e346d7a9f 100644 --- a/crates/starknet_client/src/writer/objects/transaction.rs +++ b/crates/starknet_client/src/writer/objects/transaction.rs @@ -27,7 +27,7 @@ use starknet_api::deprecated_contract_class::{ EntryPointV0 as DeprecatedEntryPoint, }; use starknet_api::state::EntryPoint; -use starknet_api::transaction::{ +use starknet_api::transaction::fields::{ AccountDeploymentData, Calldata, ContractAddressSalt, @@ -36,8 +36,8 @@ use starknet_api::transaction::{ PaymasterData, Tip, TransactionSignature, - TransactionVersion, }; +use starknet_api::transaction::TransactionVersion; // Each transaction type has a field called `type`. This field needs to be of a type that // serializes to/deserializes from a constant string. diff --git a/crates/tests-integration/src/state_reader.rs b/crates/tests-integration/src/state_reader.rs index 5365ade8e0..850dde4cd0 100644 --- a/crates/tests-integration/src/state_reader.rs +++ b/crates/tests-integration/src/state_reader.rs @@ -38,7 +38,7 @@ use starknet_api::block::{ use starknet_api::core::{ChainId, ClassHash, ContractAddress, Nonce, SequencerContractAddress}; use starknet_api::deprecated_contract_class::ContractClass as DeprecatedContractClass; use starknet_api::state::{StorageKey, ThinStateDiff}; -use starknet_api::transaction::Fee; +use starknet_api::transaction::fields::Fee; use starknet_api::{contract_address, felt}; use starknet_client::reader::PendingData; use starknet_types_core::felt::Felt;