def do_test_bloom(test_logs):
 for data in test_logs:
  address = data['address']
  b = bloom.bloom_insert(0, decode_hex(address))
  for t in data['topics']:
   b = bloom.bloom_insert(b, decode_hex(t))
  topics = [decode_int_from_hex(x) for x in data['topics']]
  log = pb.Log(decode_hex(address), topics, '')
  log_bloom = bloom.b64(bloom.bloom_from_list(log.bloomables()))
  assert (encode_hex(log_bloom) == encode_hex_from_int(b))
  assert (str_to_bytes(data['bloom']) == encode_hex(log_bloom))

def do_test_bloom ( test_logs ) : for data in test_logs : address = data [ 'address' ] b = bloom . bloom_insert ( 0 , decode_hex ( address ) ) for t in data [ 'topics' ] : b = bloom . bloom_insert ( b , decode_hex ( t ) ) topics = [ decode_int_from_hex ( x ) for x in data [ 'topics' ] ] log = pb . Log ( decode_hex ( address ) , topics , '' ) log_bloom = bloom . b64 ( bloom . bloom_from_list ( log . bloomables ( ) ) ) assert ( encode_hex ( log_bloom ) == encode_hex_from_int ( b ) ) assert ( str_to_bytes ( data [ 'bloom' ] ) == encode_hex ( log_bloom ) )
the logs sections is a mapping between the blooms and their corresponding logentries .