Skip to content

Commit

Permalink
chore: make calldata macro self contained
Browse files Browse the repository at this point in the history
  • Loading branch information
ArniStarkware committed Oct 20, 2024
1 parent 69e6b54 commit 113ef96
Show file tree
Hide file tree
Showing 14 changed files with 5 additions and 20 deletions.
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::{ContractAddressSalt, ValidResourceBounds};
use starknet_api::{
calldata,
class_hash,
Expand Down
1 change: 0 additions & 1 deletion crates/blockifier/src/execution/stack_trace_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use regex::Regex;
use rstest::rstest;
use starknet_api::core::{calculate_contract_address, Nonce};
use starknet_api::transaction::{
Calldata,
ContractAddressSalt,
Fee,
TransactionSignature,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use pretty_assertions::assert_eq;
use starknet_api::core::ContractAddress;
use starknet_api::execution_utils::format_panic_data;
use starknet_api::state::StorageKey;
use starknet_api::transaction::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 @@ -6,7 +6,6 @@ use pretty_assertions::assert_eq;
use starknet_api::core::PatriciaKey;
use starknet_api::execution_utils::format_panic_data;
use starknet_api::state::StorageKey;
use starknet_api::transaction::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,5 +1,4 @@
use starknet_api::execution_utils::format_panic_data;
use starknet_api::transaction::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,3 @@
use starknet_api::transaction::Calldata;
use starknet_api::{calldata, felt};
use test_case::test_case;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use starknet_api::state::StorageKey;
use starknet_api::transaction::Calldata;
use starknet_api::{calldata, felt};
use test_case::test_case;

Expand Down
1 change: 0 additions & 1 deletion crates/blockifier/src/test_utils/prices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use cached::proc_macro::cached;
use cairo_vm::vm::runners::cairo_runner::ExecutionResources;
use starknet_api::core::ContractAddress;
use starknet_api::test_utils::invoke::InvokeTxArgs;
use starknet_api::transaction::Calldata;
use starknet_api::{calldata, felt};

use crate::abi::abi_utils::{get_fee_token_var_address, selector_from_name};
Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/test_utils/struct_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde_json::Value;
use starknet_api::block::{BlockHash, BlockNumber, BlockTimestamp, NonzeroGasPrice};
use starknet_api::core::{ChainId, ClassHash, ContractAddress, Nonce, PatriciaKey};
use starknet_api::hash::StarkHash;
use starknet_api::transaction::{Calldata, Fee, TransactionHash, TransactionVersion};
use starknet_api::transaction::{Fee, TransactionHash, TransactionVersion};
use starknet_api::{calldata, contract_address, felt, patricia_key};
use starknet_types_core::felt::Felt;

Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/test_utils/transfers_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use rand::rngs::StdRng;
use rand::{Rng, SeedableRng};
use starknet_api::core::ContractAddress;
use starknet_api::test_utils::NonceManager;
use starknet_api::transaction::{Calldata, Fee, TransactionVersion};
use starknet_api::transaction::{Fee, TransactionVersion};
use starknet_api::{calldata, felt, invoke_tx_args};
use starknet_types_core::felt::Felt;

Expand Down
1 change: 0 additions & 1 deletion crates/blockifier/src/transaction/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use starknet_api::test_utils::invoke::InvokeTxArgs;
use starknet_api::test_utils::NonceManager;
use starknet_api::transaction::{
AllResourceBounds,
Calldata,
ContractAddressSalt,
Fee,
GasVectorComputationMode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use papyrus_storage::state::StateStorageWriter;
use starknet_api::block::BlockNumber;
use starknet_api::deprecated_contract_class::ContractClass as DeprecatedContractClass;
use starknet_api::state::{StateDiff, StorageKey};
use starknet_api::transaction::Calldata;
use starknet_api::{calldata, felt};
use starknet_types_core::felt::Felt;

Expand Down
8 changes: 1 addition & 7 deletions crates/papyrus_rpc/tests/gateway_integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ use papyrus_rpc::{
TransactionVersion1RPC0_8,
};
use starknet_api::core::{ChainId, ContractAddress, EntryPointSelector, Nonce, PatriciaKey};
use starknet_api::transaction::{
Calldata,
Fee,
Transaction,
TransactionOptions,
TransactionSignature,
};
use starknet_api::transaction::{Fee, Transaction, TransactionOptions, TransactionSignature};
use starknet_api::transaction_hash::get_transaction_hash;
use starknet_api::{calldata, contract_address, felt, patricia_key};
use starknet_client::writer::objects::transaction::InvokeTransaction as SNClientInvokeTransaction;
Expand Down
2 changes: 1 addition & 1 deletion crates/starknet_api/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ pub struct Calldata(pub Arc<Vec<Felt>>);
#[macro_export]
macro_rules! calldata {
( $( $x:expr ),* ) => {
Calldata(vec![$($x),*].into())
$crate::transaction::Calldata(vec![$($x),*].into())
};
}

Expand Down

0 comments on commit 113ef96

Please sign in to comment.