2022-03-30 10:13:34 +02:00
|
|
|
# standard imports
|
|
|
|
import hashlib
|
2021-08-26 10:09:47 +02:00
|
|
|
|
2021-08-27 12:43:12 +02:00
|
|
|
|
2022-03-30 10:13:34 +02:00
|
|
|
class SyncFilter:
|
2021-08-27 12:43:12 +02:00
|
|
|
|
2022-03-17 11:09:12 +01:00
|
|
|
def sum(self):
|
2022-03-30 10:13:34 +02:00
|
|
|
s = self.common_name()
|
|
|
|
h = hashlib.sha256()
|
|
|
|
h.update(s.encode('utf-8'))
|
|
|
|
return h.digest()
|
|
|
|
|
2021-02-17 12:44:35 +01:00
|
|
|
|
2022-03-17 11:09:12 +01:00
|
|
|
def filter(self, conn, block, tx):
|
|
|
|
raise NotImplementedError()
|
2022-03-30 10:13:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
def common_name(self):
|
|
|
|
s = self.__module__ + '.' + self.__class__.__name__
|
|
|
|
return s.replace('.', '_')
|