Set defaults for common name and sum in filter

This commit is contained in:
lash 2022-03-30 08:13:34 +00:00
parent 8527901e6c
commit af6eedf87e
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
1 changed files with 14 additions and 6 deletions

View File

@ -1,12 +1,20 @@
# standard imports
import hashlib
class SyncFilter:
def common_name(self):
raise NotImplementedError()
def sum(self):
raise NotImplementedError()
s = self.common_name()
h = hashlib.sha256()
h.update(s.encode('utf-8'))
return h.digest()
def filter(self, conn, block, tx):
raise NotImplementedError()
def common_name(self):
s = self.__module__ + '.' + self.__class__.__name__
return s.replace('.', '_')