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 13, 2024
1 parent fbc5be8 commit 9df9c1b
Show file tree
Hide file tree
Showing 158 changed files with 340 additions and 342 deletions.
2 changes: 1 addition & 1 deletion crates/batcher/src/block_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,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;

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 @@ -3,7 +3,7 @@ use std::ops::Range;
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;

pub fn test_txs(tx_hash_range: Range<usize>) -> Vec<Transaction> {
tx_hash_range
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, felt, 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 @@ -52,7 +52,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::{Calldata, ContractAddressSalt, ValidResourceBounds};
use starknet_api::transaction::fields::{Calldata, 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
2 changes: 1 addition & 1 deletion crates/blockifier/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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::GasVectorComputationMode;
use starknet_api::transaction::fields::GasVectorComputationMode;

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 @@ -19,7 +19,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::{
Calldata,
ContractAddressSalt,
Fee,
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 @@ -5,7 +5,7 @@ use itertools::Itertools;
use pretty_assertions::assert_eq;
use rstest::rstest;
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
@@ -1,7 +1,7 @@
use pretty_assertions::assert_eq;
use starknet_api::core::ContractAddress;
use starknet_api::state::StorageKey;
use starknet_api::transaction::Calldata;
use starknet_api::transaction::fields::Calldata;
use starknet_api::{calldata, felt};
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
Expand Up @@ -5,7 +5,7 @@ use cairo_vm::vm::runners::cairo_runner::ExecutionResources;
use pretty_assertions::assert_eq;
use starknet_api::core::PatriciaKey;
use starknet_api::state::StorageKey;
use starknet_api::transaction::Calldata;
use starknet_api::transaction::fields::Calldata;
use starknet_api::{calldata, felt, patricia_key};
use test_case::test_case;

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 starknet_api::{calldata, felt};
use test_case::test_case;

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 starknet_api::{calldata, felt};
use test_case::test_case;

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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use starknet_api::state::StorageKey;
use starknet_api::transaction::Calldata;
use starknet_api::transaction::fields::Calldata;
use starknet_api::{calldata, felt};
use test_case::test_case;

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
7 changes: 6 additions & 1 deletion crates/blockifier/src/fee/fee_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ use rstest::rstest;
use starknet_api::block::NonzeroGasPrice;
use starknet_api::execution_resources::{GasAmount, GasVector};
use starknet_api::invoke_tx_args;
use starknet_api::transaction::{Fee, GasVectorComputationMode, Resource, ValidResourceBounds};
use starknet_api::transaction::fields::{
Fee,
GasVectorComputationMode,
Resource,
ValidResourceBounds,
};

use crate::blockifier::block::GasPrices;
use crate::context::BlockContext;
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 @@ -5,7 +5,8 @@ use pretty_assertions::assert_eq;
use rstest::{fixture, rstest};
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
Loading

0 comments on commit 9df9c1b

Please sign in to comment.