Пример #1
0
 def match(type_expr) -> Type['ParameterSection']:
     try:
         cls = Micheline.match(type_expr)
         if not issubclass(cls, ParameterSection):
             cls = ParameterSection.create_type(args=[cls])
     except Exception as e:
         raise MichelsonRuntimeError('parameter', *e.args) from e
     return cls
Пример #2
0
 def match(type_expr) -> Type['StorageSection']:
     try:
         cls = Micheline.match(type_expr)
         if not issubclass(cls, StorageSection):
             cls = StorageSection.create_type(args=[cls])
         assert cls.args[
             0].field_name is None, f'argument type cannot be annotated: %{cls.args[0].field_name}'  # type: ignore
     except Exception as e:
         raise MichelsonRuntimeError('storage', *e.args) from e
     return cls  # type: ignore
Пример #3
0
 def execute(cls, stack: MichelsonStack, stdout: List[str], context: AbstractContext):
     a = stack.pop1()
     assert a.is_packable(), f'expected packable type, got {a.prim}'
     raise MichelsonRuntimeError(repr(a))