Skip to content

Commit

Permalink
refactor(gateway): remove wrapper function (#1800)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayeletstarkware authored Nov 5, 2024
1 parent fafb348 commit 3c064c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions crates/gateway/src/stateless_transaction_validator_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use assert_matches::assert_matches;
use mempool_test_utils::starknet_api_test_utils::{
rpc_declare_tx,
rpc_tx_for_testing,
zero_resource_bounds_mapping,
RpcTransactionArgs,
TransactionType,
NON_EMPTY_RESOURCE_BOUNDS,
Expand Down Expand Up @@ -125,7 +124,8 @@ fn test_positive_flow(
validate_non_zero_l2_gas_fee: false,
..*DEFAULT_VALIDATOR_CONFIG_FOR_TESTING
},
zero_resource_bounds_mapping(),
AllResourceBounds::default()
,
StatelessTransactionValidatorError::ZeroResourceBounds{
resource: Resource::L1Gas, resource_bounds: ResourceBounds::default()
}
Expand Down
8 changes: 2 additions & 6 deletions crates/mempool_test_utils/src/starknet_api_test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl Default for RpcTransactionArgs {
fn default() -> Self {
Self {
sender_address: TEST_SENDER_ADDRESS.into(),
resource_bounds: zero_resource_bounds_mapping(),
resource_bounds: AllResourceBounds::default(),
calldata: Default::default(),
signature: Default::default(),
}
Expand Down Expand Up @@ -145,10 +145,6 @@ pub fn rpc_tx_for_testing(
pub const NON_EMPTY_RESOURCE_BOUNDS: ResourceBounds =
ResourceBounds { max_amount: GasAmount(1), max_price_per_unit: GasPrice(1) };

pub fn zero_resource_bounds_mapping() -> AllResourceBounds {
AllResourceBounds::default()
}

pub fn test_resource_bounds_mapping() -> AllResourceBounds {
AllResourceBounds {
l1_gas: ResourceBounds {
Expand Down Expand Up @@ -500,7 +496,7 @@ impl Default for DeclareTxArgs {
signature: TransactionSignature::default(),
sender_address: TEST_SENDER_ADDRESS.into(),
version: TransactionVersion::THREE,
resource_bounds: zero_resource_bounds_mapping(),
resource_bounds: AllResourceBounds::default(),
tip: Tip::default(),
nonce_data_availability_mode: DataAvailabilityMode::L1,
fee_data_availability_mode: DataAvailabilityMode::L1,
Expand Down

0 comments on commit 3c064c7

Please sign in to comment.