@@ -266,6 +266,10 @@ def format_parameter_import(cls, package: str, module_name: str, entrypoint: str
266266 parameter_cls = f'{ snake_to_pascal (entrypoint )} Parameter'
267267 return f'{ package } .types.{ module_name } .parameter.{ pascal_to_snake (entrypoint )} ' , parameter_cls
268268
269+ @classmethod
270+ def format_empty_operation_import (cls ) -> Tuple [str , str ]:
271+ return 'dipdup.models' , 'OperationData'
272+
269273 @classmethod
270274 def format_origination_argument (cls , module_name : str , optional : bool ) -> Tuple [str , str ]:
271275 storage_cls = f'{ snake_to_pascal (module_name )} Storage'
@@ -399,20 +403,20 @@ def __post_init_post_parse__(self):
399403 raise ConfigurationError ('Transactions with entrypoint must also have destination' )
400404
401405 def iter_imports (self , package : str ) -> Iterator [Tuple [str , str ]]:
402- if not self .entrypoint :
403- return
404-
405- module_name = self .destination_contract_config . module_name
406- yield 'dipdup.models' , 'Transaction'
407- yield self . format_parameter_import ( package , module_name , self . entrypoint )
408- yield self .format_storage_import ( package , module_name )
406+ if self .entrypoint :
407+ module_name = self . destination_contract_config . module_name
408+ yield 'dipdup.models' , 'Transaction'
409+ yield self .format_parameter_import ( package , module_name , self . entrypoint )
410+ yield self . format_storage_import ( package , module_name )
411+ else :
412+ yield self .format_empty_operation_import ( )
409413
410414 def iter_arguments (self ) -> Iterator [Tuple [str , str ]]:
411- if not self .entrypoint :
412- yield self .format_empty_operation_argument (self .transaction_id , self .optional )
413- else :
415+ if self .entrypoint :
414416 module_name = self .destination_contract_config .module_name
415417 yield self .format_operation_argument (module_name , self .entrypoint , self .optional )
418+ else :
419+ yield self .format_empty_operation_argument (self .transaction_id , self .optional )
416420
417421 @property
418422 def source_contract_config (self ) -> ContractConfig :
@@ -650,24 +654,6 @@ class OperationIndexConfig(IndexConfig):
650654 first_level : int = 0
651655 last_level : int = 0
652656
653- @property
654- def contract_configs (self ) -> List [ContractConfig ]:
655- if not self .contracts :
656- return []
657- for contract in self .contracts :
658- if not isinstance (contract , ContractConfig ):
659- raise ConfigInitializationException
660- return cast (List [ContractConfig ], self .contracts )
661-
662- @property
663- def entrypoints (self ) -> Set [str ]:
664- entrypoints = set ()
665- for handler in self .handlers :
666- for pattern in handler .pattern :
667- if isinstance (pattern , OperationHandlerTransactionPatternConfig ) and pattern .entrypoint :
668- entrypoints .add (pattern .entrypoint )
669- return entrypoints
670-
671657
672658@dataclass
673659class BigMapHandlerConfig (HandlerConfig , kind = 'handler' ):
0 commit comments