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

test(starknet_api): remove the version argument from l1 handler tx args #2699

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
1 change: 0 additions & 1 deletion crates/blockifier/src/test_utils/l1_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pub fn l1handler_tx(l1_fee: Fee, contract_address: ContractAddress) -> L1Handler
];

executable_l1_handler_tx(L1HandlerTxArgs {
version: starknet_api::transaction::L1HandlerTransaction::VERSION,
contract_address,
entry_point_selector: selector_from_name("l1_handler_set_value"),
calldata,
Expand Down
21 changes: 3 additions & 18 deletions crates/starknet_api/src/test_utils/l1_handler.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use crate::core::{ContractAddress, EntryPointSelector, Nonce};
use crate::executable_transaction::L1HandlerTransaction as ExecutableL1HandlerTransaction;
use crate::transaction::fields::{Calldata, Fee};
use crate::transaction::{L1HandlerTransaction, TransactionHash, TransactionVersion};
use crate::transaction::{L1HandlerTransaction, TransactionHash};

#[derive(Clone)]
#[derive(Clone, Default)]
pub struct L1HandlerTxArgs {
pub version: TransactionVersion,
pub nonce: Nonce,
pub contract_address: ContractAddress,
pub entry_point_selector: EntryPointSelector,
Expand All @@ -14,20 +13,6 @@ pub struct L1HandlerTxArgs {
pub paid_fee_on_l1: Fee,
}

impl Default for L1HandlerTxArgs {
fn default() -> Self {
L1HandlerTxArgs {
version: L1HandlerTransaction::VERSION,
nonce: Nonce::default(),
contract_address: ContractAddress::default(),
entry_point_selector: EntryPointSelector::default(),
calldata: Calldata::default(),
tx_hash: TransactionHash::default(),
paid_fee_on_l1: Fee::default(),
}
}
}

/// Utility macro for creating `L1HandlerTransaction` to reduce boilerplate.
#[macro_export]
macro_rules! l1_handler_tx_args {
Expand All @@ -50,7 +35,7 @@ pub fn executable_l1_handler_tx(
) -> ExecutableL1HandlerTransaction {
ExecutableL1HandlerTransaction {
tx: L1HandlerTransaction {
version: l1_handler_tx_args.version,
version: L1HandlerTransaction::VERSION,
nonce: l1_handler_tx_args.nonce,
contract_address: l1_handler_tx_args.contract_address,
entry_point_selector: l1_handler_tx_args.entry_point_selector,
Expand Down
Loading