Set defaults for common name and sum in filter
This commit is contained in:
		
							parent
							
								
									8527901e6c
								
							
						
					
					
						commit
						af6eedf87e
					
				| @ -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('.', '_') | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user