Esempio n. 1
0
 def execute(cls, stack: MichelsonStack, stdout: List[str], context: AbstractContext):
     lazy_diff = []  # type: ignore
     # FIXME: AssertionError instead of informational exception
     with suppress(AssertionError):
         stack.peek().aggregate_lazy_diff(lazy_diff)
     stdout.append(f'BIG_MAP_DIFF')
     return cls(lazy_diff=lazy_diff, stack_items_added=1)
Esempio n. 2
0
 def execute(cls, stack: MichelsonStack, stdout: List[str], context: AbstractContext):
     depth = cls.args[0].get_int() - 1  # type: ignore
     stack.protect(count=depth)
     res = stack.peek().duplicate()
     stack.restore(count=depth)
     stack.push(res)
     stdout.append(format_stdout(cls.prim, [*Wildcard.n(depth), res], [res, *Wildcard.n(depth), res], depth))  # type: ignore
     return cls(stack_items_added=1)
Esempio n. 3
0
 def execute(cls, stack: MichelsonStack, stdout: List[str],
             context: AbstractContext):
     res = stack.peek().duplicate()
     stack.push(res)
     stdout.append(format_stdout(cls.prim, [res], [res, res]))
     return cls()