Example #1
0
    def run(self):
        # This is a workaround to stop a possibly existing invalid
        # precompiled `contracts.json` from preventing us from compiling a new one
        os.environ['_RAIDEN_CONTRACT_MANAGER_SKIP_PRECOMPILED'] = '1'

        try:
            from solc import compile_files  # noqa
        except ModuleNotFoundError:
            print('py-solc is not installed, skipping contracts compilation')
            return

        from raiden_contracts.contract_manager import (
            ContractManager,
            CONTRACTS_PRECOMPILED_PATH,
            CONTRACTS_SOURCE_DIRS,
        )

        try:
            contract_manager = ContractManager(CONTRACTS_SOURCE_DIRS)
            contract_manager.store_compiled_contracts(
                CONTRACTS_PRECOMPILED_PATH)
        except RuntimeError:
            import traceback
            print("Couldn't compile the contracts!")
            traceback.print_exc()
Example #2
0
    def run(self):
        from raiden_contracts.contract_manager import (
            ContractManager,
            CONTRACTS_PRECOMPILED_PATH,
            CONTRACTS_SOURCE_DIRS,
        )
        try:
            from solc import compile_files  # noqa
        except ModuleNotFoundError:
            print('py-solc is not installed, skipping contracts compilation')
            return

        try:
            contract_manager = ContractManager(CONTRACTS_SOURCE_DIRS)
            contract_manager.store_compiled_contracts(
                CONTRACTS_PRECOMPILED_PATH)
        except RuntimeError:
            import traceback
            print("Couldn't compile the contracts!")
            traceback.print_exc()