<commit_before>from sha3 import sha3_256

assert sha3_256(b'').hexdigest() == 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'


def test_filtering_single_topic(rpc_client,
                                call_emitter_method,
                                rpc_emitter_contract_address,
                                LogFunctions,
                                LogTopics,
                                Events):

    filter_id = rpc_client(
        method='eth_newFilter',
        params=[{
            'from_block': 'earliest',
            'to_block': 'latest',
            'address': rpc_emitter_contract_address,
            'topics': [],
        }]
    )

    call_emitter_method(LogFunctions.logNoArgs, [Events.LogNoArguments])

    changes = rpc_client(
        method='eth_getFilterChanges',
        params=[filter_id],
    )

    assert len(changes) == 1
    log_entry = changes[0]
    assert LogTopics.LogNoArguments in log_entry['topics']

    changes = rpc_client(
        method='eth_getFilterChanges',
        params=[filter_id],
    )<commit_msg>tests: force text for comparison<commit_after>from sha3 import sha3_256

assert sha3_256(b'').hexdigest() == 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470'

from testrpc.client.utils import force_text


def test_filtering_single_topic(rpc_client,
                                call_emitter_method,
                                rpc_emitter_contract_address,
                                LogFunctions,
                                LogTopics,
                                Events):

    filter_id = rpc_client(
        method='eth_newFilter',
        params=[{
            'from_block': 'earliest',
            'to_block': 'latest',
            'address': rpc_emitter_contract_address,
            'topics': [],
        }]
    )

    call_emitter_method(LogFunctions.logNoArgs, [Events.LogNoArguments])

    changes = rpc_client(
        method='eth_getFilterChanges',
        params=[filter_id],
    )

    assert len(changes) == 1
    log_entry = changes[0]
    assert force_text(LogTopics.LogNoArguments) in log_entry['topics']

    changes = rpc_client(
        method='eth_getFilterChanges',
        params=[filter_id],
    )
{'fraction_non_alphanumeric': 0.08868092691622104, 'fraction_numerical': 0.04723707664884135, 'mean_word_length': 1.985372340425532, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '243675', 'n_tokens_mistral': 746, 'n_tokens_neox': 658, 'n_words': 96}