Skip to content

Commit

Permalink
refactor(execution): change get fee token blance in state api to get …
Browse files Browse the repository at this point in the history
…&self and not &mut self
  • Loading branch information
meship-starkware committed Jul 28, 2024
1 parent d2d9fa4 commit a9b893d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion crates/blockifier/src/state/state_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub trait StateReader {
// TODO(Dori, 1/9/2023): NEW_TOKEN_SUPPORT Determine fee token address based on tx version,
// once v3 is introduced.
fn get_fee_token_balance(
&mut self,
&self,
contract_address: ContractAddress,
fee_token_address: ContractAddress,
) -> Result<(Felt, Felt), StateError> {
Expand Down
12 changes: 6 additions & 6 deletions crates/blockifier/src/transaction/execution_flavors_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn create_flavors_test_state(
/// Returns the new balance.
fn check_balance<S: StateReader>(
current_balance: Felt,
state: &mut CachedState<S>,
state: &CachedState<S>,
account_address: ContractAddress,
chain_info: &ChainInfo,
fee_type: &FeeType,
Expand Down Expand Up @@ -469,7 +469,7 @@ fn test_simulate_validate_charge_fee_mid_execution(
);
let current_balance = check_balance(
current_balance,
&mut state,
&state,
account_address,
&block_context.chain_info,
&fee_type,
Expand Down Expand Up @@ -520,7 +520,7 @@ fn test_simulate_validate_charge_fee_mid_execution(
);
let current_balance = check_balance(
current_balance,
&mut state,
&state,
account_address,
chain_info,
&fee_type,
Expand Down Expand Up @@ -564,7 +564,7 @@ fn test_simulate_validate_charge_fee_mid_execution(
block_limit_fee,
block_limit_fee,
);
check_balance(current_balance, &mut state, account_address, chain_info, &fee_type, charge_fee);
check_balance(current_balance, &state, account_address, chain_info, &fee_type, charge_fee);
}

#[rstest]
Expand Down Expand Up @@ -654,7 +654,7 @@ fn test_simulate_validate_charge_fee_post_execution(
);
let current_balance = check_balance(
current_balance,
&mut state,
&state,
account_address,
chain_info,
&fee_type,
Expand Down Expand Up @@ -724,7 +724,7 @@ fn test_simulate_validate_charge_fee_post_execution(
);
check_balance(
current_balance,
&mut state,
&state,
account_address,
chain_info,
&fee_type,
Expand Down

0 comments on commit a9b893d

Please sign in to comment.