Skip to content

Commit

Permalink
test(starknet_api): chage default resource bounds to all
Browse files Browse the repository at this point in the history
  • Loading branch information
TzahiTaub committed Nov 3, 2024
1 parent 0b906af commit 55f48b4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions crates/starknet_api/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1158,10 +1158,19 @@ impl ValidResourceBounds {
}
}

// TODO(Nimrod): Default testing bounds should probably be AllResourceBounds variant.
#[cfg(any(feature = "testing", test))]
pub fn create_for_testing() -> Self {
Self::L1Gas(ResourceBounds { max_amount: GasAmount(0), max_price_per_unit: GasPrice(1) })
let default_l2_gas_amount = GasAmount(10000000000); // Sufficient to avoid out of gas errors.
let default_resource =
ResourceBounds { max_amount: GasAmount(0), max_price_per_unit: GasPrice(1) };
Self::AllResources(AllResourceBounds {
l1_gas: default_resource,
l2_gas: ResourceBounds {
max_amount: default_l2_gas_amount,
max_price_per_unit: GasPrice(0), // Set to zero for no enforce_fee mechanism.
},
l1_data_gas: default_resource,
})
}

/// Utility method to "zip" an amount vector and a price vector to get an AllResourceBounds.
Expand Down

0 comments on commit 55f48b4

Please sign in to comment.