chainsyncer/chainsyncer/filter.py

21 lines
405 B
Python
Raw Normal View History

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