Skip to content

Commit

Permalink
De-duplicate block_context fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
notlesh committed Feb 6, 2024
1 parent 4ff0d42 commit de2cce6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
20 changes: 1 addition & 19 deletions src/hints/syscalls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,27 +348,9 @@ mod tests {
use starknet_api::{contract_address, patricia_key};

use super::*;
use crate::hints::tests::tests::block_context;
use crate::ExecutionHelperWrapper;

#[fixture]
fn block_context() -> BlockContext {
BlockContext {
chain_id: ChainId("SN_GOERLI".to_string()),
block_number: BlockNumber(1_000_000),
block_timestamp: BlockTimestamp(1_704_067_200),
sequencer_address: contract_address!("0x0"),
fee_token_addresses: FeeTokenAddresses {
eth_fee_token_address: contract_address!("0x1"),
strk_fee_token_address: contract_address!("0x2"),
},
vm_resource_fee_cost: Arc::new(HashMap::new()),
gas_prices: GasPrices { eth_l1_gas_price: 1, strk_l1_gas_price: 1 },
invoke_tx_max_n_steps: 1,
validate_max_n_steps: 1,
max_recursion_depth: 50,
}
}

#[fixture]
fn exec_scopes(block_context: BlockContext) -> ExecutionScopes {
let syscall_ptr = Relocatable::from((0, 0));
Expand Down
4 changes: 2 additions & 2 deletions src/hints/tests.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[cfg(test)]
mod tests {
pub(crate) mod tests {
use std::sync::Arc;

use blockifier::block_context::{BlockContext, FeeTokenAddresses, GasPrices};
Expand Down Expand Up @@ -42,7 +42,7 @@ mod tests {
}

#[fixture]
fn block_context() -> BlockContext {
pub fn block_context() -> BlockContext {
BlockContext {
chain_id: ChainId("SN_GOERLI".to_string()),
block_number: BlockNumber(1_000_000),
Expand Down

0 comments on commit de2cce6

Please sign in to comment.