diff --git a/operate/services/manage.py b/operate/services/manage.py index e8d452728..21069148d 100644 --- a/operate/services/manage.py +++ b/operate/services/manage.py @@ -369,6 +369,7 @@ def deploy_service_onchain( # pylint: disable=too-many-statements def deploy_service_onchain_from_safe( # pylint: disable=too-many-statements,too-many-locals self, hash: str, + update: bool = False, ) -> None: """ Deploy as service on-chain @@ -427,7 +428,6 @@ def deploy_service_onchain_from_safe( # pylint: disable=too-many-statements,too f"address: {wallet.safe}; required olas: {required_olas}; your balance: {balance}" ) - on_chain_hash = self._get_on_chain_hash(service) is_first_mint = self._get_on_chain_state(service) == OnChainState.NON_EXISTENT is_update = (not is_first_mint) and (on_chain_hash is not None) and (on_chain_hash != service.hash) @@ -436,15 +436,17 @@ def deploy_service_onchain_from_safe( # pylint: disable=too-many-statements,too self.logger.info(f"{is_first_mint=}") self.logger.info(f"{is_update=}") - if is_update: - self.terminate_service_on_chain_from_safe(hash=hash) + is_update = update # TODO fix + # if is_update: + # self.terminate_service_on_chain_from_safe(hash=hash) - if is_first_mint or (is_update and self._get_on_chain_state(service) == OnChainState.PRE_REGISTRATION): - if not is_update: - self.logger.info("Minting the on-chain service") - else: - self.logger.info("Updating the on-chain service") + # if is_first_mint or (is_update and self._get_on_chain_state(service) == OnChainState.PRE_REGISTRATION): + # if not is_update: + # self.logger.info("Minting the on-chain service") + # else: + # self.logger.info("Updating the on-chain service") + if is_first_mint: receipt = ( sftxb.new_tx() .add( diff --git a/operate/types.py b/operate/types.py index 1babb5f82..efd3e8cf7 100644 --- a/operate/types.py +++ b/operate/types.py @@ -166,17 +166,6 @@ class LedgerConfig(LocalResource): LedgerConfigs = t.List[LedgerConfig] -class ServiceState(enum.IntEnum): - """Service state""" - - NON_EXISTENT = 0 - PRE_REGISTRATION = 1 - ACTIVE_REGISTRATION = 2 - FINISHED_REGISTRATION = 3 - DEPLOYED = 4 - TERMINATED_BONDED = 5 - - class DeploymentConfig(TypedDict): """Deployments template."""