You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: state_dump.rs
    path of file: ./repos/nearcore/tools/state-viewer/src
    
    the code of the file until where you have to start completion: use chrono::Utc;
use near_chain::types::RuntimeAdapter;
use near_chain_configs::{Genesis, GenesisChangeConfig, GenesisConfig};
use near_crypto::PublicKey;
use near_epoch_manager::Epoc
    
    fn test_dump_state_respect_select_account_ids() {
        let epoch_length = 4;
        let (store, genesis, mut env, near_config) = setup(epoch_length, PROTOCOL_VERSION, false);
        let genesis_hash = *env.clients[0].chain.genesis().hash();

        let signer0 =
            InMemorySigner::from_seed("test0".parse().unwrap(), KeyType::ED25519, "test0");
        let tx00 = SignedTransaction::from_actions(
            1,
            "test0".parse().unwrap(),
            "test0".parse().unwrap(),
            &signer0,
            vec![Action::DeployContract(DeployContractAction {
                code: near_test_contracts::backwards_compatible_rs_contract().to_vec(),
            })],
            genesis_hash,
        );
        let tx01 = SignedTransaction::stake(
            1,
            "test0".parse().unwrap(),
            &signer0,
            TESTING_INIT_STAKE,
            signer0.public_key.clone(),
            genesis_hash,
        );
        assert_eq!(env.clients[0].process_tx(tx00, false, false), ProcessTxResponse::ValidTx);
        assert_eq!(env.clients[0].process_tx(tx01, false, false), ProcessTxResponse::ValidTx);

        let signer1 =
            InMemorySigner::from_seed("test1".parse().unwrap(), KeyType::ED25519, "test1");
        let tx1 = SignedTransaction::stake(
            1,
            "test1".parse().unwrap(),
            &signer1,
            TESTING_INIT_STAKE,
            signer1.public_key.clone(),
            genesis_hash,
        );
        assert_eq!(env.clients[0].process_tx(tx1, false, false), ProcessTxResponse::ValidTx);

        safe_produce_blocks(&mut env, 1, epoch_length * 2 + 1);

        let head = env.clients[0].chain.head().unwrap();
        let last_block_hash = head.last_block_hash;
        let cur_epoch_id = head.epoch_id;
        let block_producers = env.clients[0]
            .epoch_manager
            .get_epoch_block_producers_ordered(&cur_epoch_id, &last_block_hash)
            .unwrap();
        assert_eq!(
            block_producers.into_iter().map(|(r, _)| r.take_account_id()).collect::<HashSet<_>>(),
            HashSet::from_iter(vec!["test0".parse().unwrap(), "test1".parse().unwrap()]),
        );
        let last_block = env.clients[0].chain.get_block(&head.last_block_hash).unwrap();
        let state_roots: Vec<CryptoHash> =
            last_block.chunks().iter().map(|chunk| chunk.prev_state_root()).collect();
        initialize_genesis_state(store.clone(), &genesis, None);
        let epoch_manager = EpochManager::new_arc_handle(store.clone(), &genesis.config);
        let runtime =
            NightshadeRuntime::test(Path::new("."), store, &genesis.config, epoch_manager.clone());
        let select_account_ids = vec!["test0".parse().unwrap()];
        let new_near_config = state_dump(
            epoch_manager.as_ref(),
            runtime,
            &state_roots,
            last_block.header().clone(),
            &near_config,
            None,
            &GenesisChangeConfig::default()
                .with_select_account_ids(Some(select_account_ids.clone())),
        );
        let new_genesis = new_near_config.genesis;
        let mut expected_accounts: HashSet<AccountId> =
            new_genesis.config.validators.iter().map(|v| v.account_id.clone()).collect();
        expected_accounts.extend(select_account_ids);
        expected_accounts.insert(new_genesis.config.protocol_treasury_account.clone());
        let mut actual_accounts: HashSet<AccountId> = HashSet::new();
        new_genesis.for_each_record(|record| {
            if let StateRecord::Account { account_id, .. } = record {
                actual_accounts.insert(account_id.clone());
            }
        });
        assert_eq!(expected_accounts, actual_accounts);
        validate_genesis(&new_genesis).unwrap();
    }