Ejemplo n.º 1
0
    def setUpClass(cls):
        with open(join(dirname(__file__), f'', '__script__.json')) as f:
            script = json.loads(f.read())

        cls.program = MichelsonProgram.match(script['code'])
        cls.script = script

        with open(join(dirname(__file__), f'', '__entrypoints__.json')) as f:
            entrypoints = json.loads(f.read())

        cls.entrypoints = entrypoints
    def setUpClass(cls):
        with open(join(dirname(__file__), f'', '__script__.json')) as f:
            script = json.loads(f.read())

        cls.program = MichelsonProgram.match(script['code'])

        with open(join(dirname(__file__), f'', f'originate_sell_order.json')) as f:
            operation = json.loads(f.read())

        cls.entrypoint = f'originate_sell_order'
        cls.operation = operation
Ejemplo n.º 3
0
    def setUpClass(cls):
        with open(join(dirname(__file__), f'', '__script__.json')) as f:
            script = json.loads(f.read())

        cls.program = MichelsonProgram.match(script['code'])

        with open(join(dirname(__file__), f'', f'transferTokens.json')) as f:
            operation = json.loads(f.read())

        cls.entrypoint = f'transferTokens'
        cls.operation = operation
Ejemplo n.º 4
0
    def setUpClass(cls):
        with open(join(dirname(__file__), f'', '__script__.json')) as f:
            script = json.loads(f.read())

        cls.program = MichelsonProgram.match(script['code'])

        with open(join(dirname(__file__), f'', f'set_staking_manager_address.json')) as f:
            operation = json.loads(f.read())

        cls.entrypoint = f'set_staking_manager_address'
        cls.operation = operation
    def setUpClass(cls):
        with open(join(dirname(__file__), f'', '__script__.json')) as f:
            script = json.loads(f.read())

        cls.program = MichelsonProgram.match(script['code'])

        with open(join(dirname(__file__), f'',
                       f'set_baker_hicetnuncDAO.json')) as f:
            operation = json.loads(f.read())

        cls.entrypoint = f'set_baker_hicetnuncDAO'
        cls.operation = operation
Ejemplo n.º 6
0
    def setUpClass(cls):
        with open(join(dirname(__file__), f'', '__script__.json')) as f:
            script = json.loads(f.read())

        cls.program = MichelsonProgram.match(script['code'])

        with open(
                join(dirname(__file__), f'',
                     f'updateRewardPoolReleaseDayCount.json')) as f:
            operation = json.loads(f.read())

        cls.entrypoint = f'updateRewardPoolReleaseDayCount'
        cls.operation = operation
Ejemplo n.º 7
0
    def from_micheline(
            expression,
            context: Optional[ExecutionContext] = None) -> 'ContractInterface':
        """ Create contract from micheline expression.

        :param expression: [{'prim': 'parameter'}, {'prim': 'storage'}, {'prim': 'code'}]
        :param context: optional execution context
        :rtype: ContractInterface
        """
        program = MichelsonProgram.match(expression)
        cls = type(ContractInterface.__name__, (ContractInterface, ),
                   dict(program=program))
        context = ExecutionContext(shell=context.shell if context else None,
                                   key=context.key if context else None,
                                   script=dict(code=expression))
        return cls(context)