Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Add another fee token in test init state (#848)
Browse files Browse the repository at this point in the history
Signed-off-by: Dori Medini <[email protected]>
  • Loading branch information
dorimedini-starkware authored Sep 18, 2023
1 parent 44e1cd8 commit 851bc24
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions crates/blockifier/src/transaction/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,23 @@ pub fn create_account_tx_test_state(
// A random address that is unlikely to equal the result of the calculation of a contract
// address.
let test_account_address = contract_address!(account_address);
// TODO(Dori, 1/9/2023): NEW_TOKEN_SUPPORT add another fee token to the initial state.
let test_erc20_address = block_context.fee_token_addresses.eth_fee_token_address;
let test_strk_token_address = block_context.fee_token_addresses.strk_fee_token_address;
let test_eth_token_address = block_context.fee_token_addresses.eth_fee_token_address;
let address_to_class_hash = HashMap::from([
(test_contract_address, test_contract_class_hash),
(test_account_address, test_account_class_hash),
(test_erc20_address, test_erc20_class_hash),
(test_strk_token_address, test_erc20_class_hash),
(test_eth_token_address, test_erc20_class_hash),
]);
let minter_var_address = get_storage_var_address("permitted_minter", &[])
.expect("Failed to get permitted_minter storage address.");
let initial_balance_felt = stark_felt!(initial_account_balance);
let storage_view = HashMap::from([
((test_erc20_address, erc20_account_balance_key), stark_felt!(initial_account_balance)),
((test_strk_token_address, erc20_account_balance_key), initial_balance_felt),
((test_eth_token_address, erc20_account_balance_key), initial_balance_felt),
// Give the account mint permission.
((test_erc20_address, minter_var_address), *test_account_address.0.key()),
((test_strk_token_address, minter_var_address), *test_account_address.0.key()),
((test_eth_token_address, minter_var_address), *test_account_address.0.key()),
]);
CachedState::from(DictStateReader {
address_to_class_hash,
Expand Down

0 comments on commit 851bc24

Please sign in to comment.