Exemplo n.º 1
0
 def test_value_mE_filter(self):
     min, max = (0, 3)
     filter_to_test = ValueFilter(min, max).make_filter('mE')
     self.assertEqual(True, filter_to_test(transaction_and_hash))
Exemplo n.º 2
0
 def test_value_ME_filter(self):
     min, max = (-3, -1)
     filter_to_test = ValueFilter(min, max).make_filter('ME')
     self.assertEqual(False, filter_to_test(transaction_and_hash))
Exemplo n.º 3
0
    # Make filters
    filter_list = []
    time_list = filters_conf.get('time', [])

    if addr_set := set(filters_conf.get('address', [])):
        filter_list.append(AddressFilter(addr_set).make_filter())
    if bundle_set := set(filters_conf.get('bundle', [])):
        filter_list.append(BundleFilter(bundle_set).make_filter())
    if tag_set := set(filters_conf.get('tag', [])):
        filter_list.append(TagFilter(tag_set).make_filter())
    if transaction_set := set(filters_conf.get('transaction', [])):
        filter_list.append(TransactionFilter(transaction_set).make_filter())
    for v in filters_conf.get('value', []):
        filter_list.append(ValueFilter(
            min=int(v['min']),
            max=int(v['max'])).make_filter(v['rlse']))

    if (zmq_conf := config.get("zmq", {})).get("enable", False) == True:
        time_filter_list = []
        for t in time_list:
            time_filter_list.append(TimeFilter(
                start_date=t['start'],
                end_date=t['end']).make_filter(t['rlse']))
        sub = ZmqSub(url=zmq_conf['node_ip'],
                     topic=zmq_conf['topic'],
                     filterlist=filter_list+time_filter_list)
        sub.run()

    if (dmp_conf := config.get("dmp", {})).get("enable", False) == True:
        dmp_time_filter_list = []