pub(crate) fn test_mock_emulator_with_payment<VM: TestedVm>(deploy_emulator: bool) {
    let mut vm = EvmTestBuilder::new(deploy_emulator, RECIPIENT_ADDRESS).build::<VM>();

    let mut current_balance = U256::zero();
    for i in 1_u64..=5 {
        let transferred_value = (1_000_000_000 * i).into();
        let vm_result = test_payment(
            &mut vm,
            &TestContract::mock_evm_emulator().abi,
            &mut current_balance,
            transferred_value,
        );

        let balance_storage_logs = vm_result.logs.storage_logs.iter().filter_map(|log| {
            (*log.log.key.address() == L2_BASE_TOKEN_ADDRESS)
                .then_some((*log.log.key.key(), h256_to_u256(log.log.value)))
        });
        let balances: HashMap<_, _> = balance_storage_logs.collect();
        assert_eq!(
            balances[&key_for_eth_balance(&RECIPIENT_ADDRESS)],
            current_balance
        );
    }
}
`deploy_emulator = false` here and below tests the mock emulator as an ordinary contract (i.e., sanity-checks its logic).
core/lib/multivm/src/versions/testonly/mock_evm.rs