Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make calldata macro self contained #1463

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 0 additions & 1 deletion crates/papyrus_execution/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ use starknet_api::deprecated_contract_class::ContractClass as DeprecatedContract
use starknet_api::state::{ContractClass, StateNumber, ThinStateDiff};
use starknet_api::test_utils::read_json_file;
use starknet_api::transaction::{
Calldata,
DeclareTransactionV0V1,
DeclareTransactionV2,
DeployAccountTransaction,
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 @@ -895,7 +895,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
Loading