Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoreira-valory committed Aug 15, 2024
1 parent 515b7c2 commit 3b2ea44
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion operate/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,6 @@ async def _create_services(request: Request) -> JSONResponse:
return USER_NOT_LOGGED_IN_ERROR
template = await request.json()
manager = operate.service_manager()
update = False
if len(manager.json) > 0:
old_hash = manager.json[0]["hash"]
if old_hash == template["hash"]:
Expand Down
12 changes: 9 additions & 3 deletions operate/services/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1162,10 +1162,16 @@ def update_service(
new_service.keys = old_service.keys
# new_Service.home_chain_id = old_service.home_chain_id

# FIXME New service must copy all chain_data from old service,
# TODO - Ensure this works as expected - New service must copy all chain_data from old service,
# but if service_template is not None, it must copy the user_params
# passed in the service_template.
new_service.chain_configs = old_service.chain_configs
# passed in the service_template and copy the remaining attributes from old_service.

new_service.chain_configs = {}
for chain_id, config in old_service.chain_configs.items():
new_service.chain_configs[chain_id] = config
if service_template:
new_service.chain_configs[chain_id].chain_data.user_params = OnChainUserParams.from_json(service_template["configurations"][chain_id])

new_service.store()

# The following logging has been added to identify OS issues when
Expand Down

0 comments on commit 3b2ea44

Please sign in to comment.