Ejemplo n.º 1
0
 def load(context: ExecutionContext, with_code=False):
     cls = type(
         MichelsonProgram.__name__,
         (MichelsonProgram, ),
         dict(
             parameter=ParameterSection.match(context.get_parameter_expr()),
             storage=StorageSection.match(context.get_storage_expr()),
             code=CodeSection.match(
                 context.get_code_expr() if with_code else []),
         ),
     )
     return cast(Type['MichelsonProgram'], cls)
Ejemplo n.º 2
0
 def load(context: ExecutionContext, with_code=False):
     cls = type(
         TztMichelsonProgram.__name__,
         (TztMichelsonProgram, ),
         dict(
             input=InputSection.match(context.get_input_expr()),
             output=OutputSection.match(context.get_output_expr()),
             code=CodeSection.match(
                 context.get_code_expr() if with_code else []),
             big_maps=BigMapsSection.match(context.get_big_maps_expr())
             if context.get_big_maps_expr() else None,
         ),
     )
     return cast(Type['TztMichelsonProgram'], cls)