Skip to content

Commit

Permalink
chore: remove public imports from starknet api transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
ArniStarkware committed Oct 20, 2024
1 parent 7c7194b commit fbcdc88
Show file tree
Hide file tree
Showing 152 changed files with 333 additions and 330 deletions.
2 changes: 1 addition & 1 deletion crates/batcher/src/batcher_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use starknet_api::core::{ContractAddress, Nonce, PatriciaKey, StateDiffCommitmen
use starknet_api::executable_transaction::Transaction;
use starknet_api::hash::PoseidonHash;
use starknet_api::state::ThinStateDiff;
use starknet_api::transaction::TransactionHash;
use starknet_api::transaction::fields::TransactionHash;
use starknet_api::{felt, nonce, patricia_key};
use starknet_batcher_types::batcher_types::{
BuildProposalInput,
Expand Down
2 changes: 1 addition & 1 deletion crates/batcher/src/block_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use serde::{Deserialize, Serialize};
use starknet_api::block::{BlockNumber, BlockTimestamp, NonzeroGasPrice};
use starknet_api::core::ContractAddress;
use starknet_api::executable_transaction::Transaction;
use starknet_api::transaction::TransactionHash;
use starknet_api::transaction::fields::TransactionHash;
use thiserror::Error;
use tokio::sync::Mutex;
use tokio::{pin, time};
Expand Down
2 changes: 1 addition & 1 deletion crates/batcher/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use indexmap::IndexMap;
use starknet_api::executable_transaction::Transaction;
use starknet_api::felt;
use starknet_api::test_utils::invoke::{executable_invoke_tx, InvokeTxArgs};
use starknet_api::transaction::TransactionHash;
use starknet_api::transaction::fields::TransactionHash;

use crate::block_builder::BlockExecutionArtifacts;

Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/abi/constants.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use starknet_api::transaction::TransactionVersion;
use starknet_api::transaction::fields::TransactionVersion;
use starknet_types_core::felt::Felt;

pub const CONSTRUCTOR_ENTRY_POINT_NAME: &str = "constructor";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use assert_matches::assert_matches;
use rstest::rstest;
use starknet_api::transaction::{TransactionVersion, ValidResourceBounds};
use starknet_api::transaction::fields::{TransactionVersion, ValidResourceBounds};

use crate::blockifier::stateful_validator::StatefulValidator;
use crate::context::BlockContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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, TransactionVersion};
use starknet_api::{declare_tx_args, deploy_account_tx_args, felt, invoke_tx_args, nonce};
use starknet_types_core::felt::Felt;

Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/bouncer_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use cairo_vm::types::builtin_name::BuiltinName;
use cairo_vm::vm::runners::cairo_runner::ExecutionResources;
use rstest::rstest;
use starknet_api::core::{ClassHash, ContractAddress, PatriciaKey};
use starknet_api::transaction::Fee;
use starknet_api::transaction::fields::Fee;
use starknet_api::{class_hash, contract_address, patricia_key, storage_key};

use super::BouncerConfig;
Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/concurrency/fee_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
4 changes: 2 additions & 2 deletions crates/blockifier/src/concurrency/fee_utils_test.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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,
) {
Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/concurrency/versioned_state_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use starknet_api::core::{
PatriciaKey,
};
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,
Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/concurrency/worker_logic_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::sync::Mutex;
use rstest::rstest;
use starknet_api::core::{ContractAddress, Nonce, PatriciaKey};
use starknet_api::test_utils::NonceManager;
use starknet_api::transaction::{
use starknet_api::transaction::fields::{
ContractAddressSalt,
Fee,
TransactionVersion,
Expand Down
6 changes: 5 additions & 1 deletion crates/blockifier/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/execution/contract_address_test.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@ use pretty_assertions::assert_eq;
use rstest::rstest;
use starknet_api::core::{calculate_contract_address, ChainId, PatriciaKey};
use starknet_api::state::StorageKey;
use starknet_api::transaction::{
use starknet_api::transaction::fields::{
Calldata,
ContractAddressSalt,
EventContent,
EventData,
EventKey,
Fee,
TransactionHash,
TransactionVersion,
QUERY_VERSION_BASE_BIT,
};
use starknet_api::transaction::{EventContent, EventData, EventKey};
use starknet_api::{calldata, felt, nonce, storage_key};
use starknet_types_core::felt::Felt;
use test_case::test_case;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 2 additions & 8 deletions crates/blockifier/src/execution/deprecated_syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/execution/entry_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ 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,
Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/execution/entry_point_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use cairo_vm::types::builtin_name::BuiltinName;
use num_bigint::BigInt;
use pretty_assertions::assert_eq;
use starknet_api::core::{EntryPointSelector, PatriciaKey};
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};
Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/execution/execution_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::entry_point::ConstructorEntryPointExecutionResult;
Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/execution/stack_trace_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use pretty_assertions::assert_eq;
use regex::Regex;
use rstest::rstest;
use starknet_api::core::{calculate_contract_address, Nonce};
use starknet_api::transaction::{
use starknet_api::transaction::fields::{
ContractAddressSalt,
Fee,
TransactionSignature,
Expand Down
7 changes: 6 additions & 1 deletion crates/blockifier/src/execution/syscalls/hint_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 2 additions & 8 deletions crates/blockifier/src/execution/syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
9 changes: 7 additions & 2 deletions crates/blockifier/src/fee/fee_checks.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/fee/fee_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 7 additions & 2 deletions crates/blockifier/src/fee/fee_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ 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::{AllResourceBounds, Fee, GasVectorComputationMode, Resource};
use starknet_api::transaction::fields::ValidResourceBounds::{AllResources, L1Gas};
use starknet_api::transaction::fields::{
AllResourceBounds,
Fee,
GasVectorComputationMode,
Resource,
};
use starknet_types_core::felt::Felt;

use crate::abi::abi_utils::get_fee_token_var_address;
Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/fee/gas_usage.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 2 additions & 1 deletion crates/blockifier/src/fee/gas_usage_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/fee/receipt.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 2 additions & 1 deletion crates/blockifier/src/fee/receipt_test.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/fee/resources.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/state/cached_state_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use indexmap::indexmap;
use pretty_assertions::assert_eq;
use rstest::rstest;
use starknet_api::core::PatriciaKey;
use starknet_api::transaction::Fee;
use starknet_api::transaction::fields::Fee;
use starknet_api::{
class_hash,
compiled_class_hash,
Expand Down
Loading

0 comments on commit fbcdc88

Please sign in to comment.