olas-operate-middleware 0.10.14__py3-none-any.whl → 0.10.16__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,8 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: olas-operate-middleware
3
- Version: 0.10.14
3
+ Version: 0.10.16
4
4
  Summary:
5
+ License-File: LICENSE
5
6
  Author: David Vilela
6
7
  Author-email: dvilelaf@gmail.com
7
8
  Requires-Python: >=3.9,<3.12
@@ -13,7 +14,7 @@ Requires-Dist: aiohttp (==3.9.5)
13
14
  Requires-Dist: argon2-cffi (==23.1.0)
14
15
  Requires-Dist: clea (==0.1.0rc4)
15
16
  Requires-Dist: cytoolz (==0.12.3)
16
- Requires-Dist: deepdiff (>=8.0.1,<9.0.0)
17
+ Requires-Dist: deepdiff (>=8.6.1,<9.0.0)
17
18
  Requires-Dist: docker (==6.1.2)
18
19
  Requires-Dist: eth-abi (==4.0.0)
19
20
  Requires-Dist: eth-account (==0.8.0)
@@ -60,7 +60,7 @@ operate/data/contracts/uniswap_v2_erc20/tests/test_contract.py,sha256=FzZbw9OTcr
60
60
  operate/keys.py,sha256=mPZ2KZujPjHZ1RNVD2vkLzK_3q6J32o9q0WCB6Raxs4,5237
61
61
  operate/ledger/__init__.py,sha256=hGTrWaPBRCodIFYUKVzfx_t_kpDa7SYyFjat8OhNRqA,3026
62
62
  operate/ledger/profiles.py,sha256=LaYPyz-1Cy-KRRuXk60W0ZXQJ2cwoWmDxYrL_psIdKo,11993
63
- operate/migration.py,sha256=mh921s8FG48XMfDu63ojrdhU7j_RZsdl5E2BvxsbkWE,16937
63
+ operate/migration.py,sha256=TJhztfHUVhZ2buKHx10vXeVo1rRAORdbqGE8fLHL15I,17305
64
64
  operate/operate_http/__init__.py,sha256=dxCIVSUos23M4R-PFZZG6k5QrOlEiK0SxhCYSFNxh7U,4711
65
65
  operate/operate_http/exceptions.py,sha256=4UFzrn-GyDD71RhkaOyFPBynL6TrrtP3eywaaU3o4fc,1339
66
66
  operate/operate_types.py,sha256=oVOzd6K_CTbmAe1pbSFr4LCajNJ_n0y6J5Wwdf_6ev8,8102
@@ -79,9 +79,9 @@ operate/services/__init__.py,sha256=isrThS-Ccu5Sc15JZgkN4uTAVaSg-NwUUSDeTyJEqLk,
79
79
  operate/services/agent_runner.py,sha256=6tJePUJmlRxlIugT2fDaCJHSrQlDnl1t9pbg3-7EmCQ,7560
80
80
  operate/services/deployment_runner.py,sha256=Su73o7cdH6fkQfj468K77J04a_TWiokJwbMyVQ25xko,27067
81
81
  operate/services/health_checker.py,sha256=MuGZ0pQ7zyJVbNU9FJR5gR8zTE7z7kCH1h5Ampv9IC0,9837
82
- operate/services/manage.py,sha256=XzT9y29x_3kaHEwziIP6uDoKxtsmufwSiwdQP3bJUy8,118147
82
+ operate/services/manage.py,sha256=FxhL2Zm46DOuCBnp8C1_i9dCwq4x9Jpo0QFsEeLDcU0,118436
83
83
  operate/services/protocol.py,sha256=FoJmHz5nukI01-VYtReMsIl3JT5RgZZSLX-mf9EXQ90,62903
84
- operate/services/service.py,sha256=1gjBu3yzwFKX54xEeyRZ_NzRjuYk_gpfWzS8JWTQ2xs,39319
84
+ operate/services/service.py,sha256=9UVscczt6GnDGGZtKix5-cg28fknD9MJdoi_-fyFLRw,39514
85
85
  operate/services/utils/__init__.py,sha256=TvioaZ1mfTRUSCtrQoLNAp4WMVXyqEJqFJM4PxSQCRU,24
86
86
  operate/services/utils/mech.py,sha256=W2x4dqodivNKXjWU-Brp40QhoUHsIMyNAO7-caMoR0Q,3821
87
87
  operate/services/utils/tendermint.py,sha256=3h9nDb2Z89T0RwUr_AaVjqtymQmsu3u6DAVCfL_k1U0,25591
@@ -91,8 +91,8 @@ operate/utils/ssl.py,sha256=O5DrDoZD4T4qQuHP8GLwWUVxQ-1qXeefGp6uDJiF2lM,4308
91
91
  operate/wallet/__init__.py,sha256=NGiozD3XhvkBi7_FaOWQ8x1thZPK4uGpokJaeDY_o2w,813
92
92
  operate/wallet/master.py,sha256=jLFLcRgO6ADok2DigpK59PFJ4mnc_0H9a4RRioYzlvw,30811
93
93
  operate/wallet/wallet_recovery_manager.py,sha256=sXEZyvFMePxQKf9NJg4HT90mPg4-7ZcTbvggMnKKzhA,7795
94
- olas_operate_middleware-0.10.14.dist-info/LICENSE,sha256=mdBDB-mWKV5Cz4ejBzBiKqan6Z8zVLAh9xwM64O2FW4,11339
95
- olas_operate_middleware-0.10.14.dist-info/METADATA,sha256=yowPbPacBjne5sKRCz_7zukTH8WY3Daq9zrtvNyBJsE,2036
96
- olas_operate_middleware-0.10.14.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
97
- olas_operate_middleware-0.10.14.dist-info/entry_points.txt,sha256=dM1g2I7ODApKQFcgl5J4NGA7pfBTo6qsUTXM-j2OLlw,44
98
- olas_operate_middleware-0.10.14.dist-info/RECORD,,
94
+ olas_operate_middleware-0.10.16.dist-info/METADATA,sha256=aR-iWzrLt6OeeXr7_NnBoYlkEcQhpgXKvrNUBoZj__4,2058
95
+ olas_operate_middleware-0.10.16.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
96
+ olas_operate_middleware-0.10.16.dist-info/entry_points.txt,sha256=dM1g2I7ODApKQFcgl5J4NGA7pfBTo6qsUTXM-j2OLlw,44
97
+ olas_operate_middleware-0.10.16.dist-info/licenses/LICENSE,sha256=mdBDB-mWKV5Cz4ejBzBiKqan6Z8zVLAh9xwM64O2FW4,11339
98
+ olas_operate_middleware-0.10.16.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.3
2
+ Generator: poetry-core 2.2.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
operate/migration.py CHANGED
@@ -348,6 +348,14 @@ class MigrationManager:
348
348
  del data["keys"]
349
349
 
350
350
  if version < 8:
351
+ for _, chain_data in data.get("chain_configs", {}).items():
352
+ if chain_data["chain_data"]["multisig"] == "0xm":
353
+ chain_data["chain_data"]["multisig"] = NON_EXISTENT_MULTISIG
354
+
355
+ if "keys" in data:
356
+ data["agent_addresses"] = [key["address"] for key in data["keys"]]
357
+ del data["keys"]
358
+
351
359
  if data["home_chain"] == "optimistic":
352
360
  data["home_chain"] = Chain.OPTIMISM.value
353
361
 
@@ -1082,12 +1082,19 @@ class ServiceManager:
1082
1082
  self.logger.info(f"{reuse_multisig=}")
1083
1083
 
1084
1084
  is_recovery_module_enabled = (
1085
- registry_contracts.gnosis_safe.is_module_enabled(
1086
- ledger_api=sftxb.ledger_api,
1087
- contract_address=service_safe_address,
1088
- module_address=CONTRACTS[Chain(chain)]["recovery_module"],
1089
- ).get("enabled")
1085
+ True # Ensure is true for non-deployed multisigs
1090
1086
  )
1087
+ if (
1088
+ service_safe_address is not None
1089
+ and service_safe_address != ZERO_ADDRESS
1090
+ ):
1091
+ is_recovery_module_enabled = (
1092
+ registry_contracts.gnosis_safe.is_module_enabled(
1093
+ ledger_api=sftxb.ledger_api,
1094
+ contract_address=service_safe_address,
1095
+ module_address=CONTRACTS[Chain(chain)]["recovery_module"],
1096
+ ).get("enabled")
1097
+ )
1091
1098
 
1092
1099
  self.logger.info(f"{is_recovery_module_enabled=}")
1093
1100
 
@@ -736,6 +736,13 @@ class Service(LocalResource):
736
736
 
737
737
  _file = CONFIG_JSON
738
738
 
739
+ @property
740
+ def json(self) -> t.Dict:
741
+ """To dictionary object."""
742
+ obj = super().json
743
+ obj["service_public_id"] = self.service_public_id()
744
+ return obj
745
+
739
746
  @staticmethod
740
747
  def determine_agent_id(service_name: str) -> int:
741
748
  """Determine the appropriate agent ID based on service name."""
@@ -1080,7 +1087,7 @@ class Service(LocalResource):
1080
1087
  Note that this method modifies os.environ. Consider if you need a backup of os.environ before using this method.
1081
1088
  """
1082
1089
  for env_var, attributes in self.env_variables.items():
1083
- os.environ[env_var] = str(attributes["value"])
1090
+ os.environ[env_var] = str(attributes.get("value", ""))
1084
1091
 
1085
1092
  def update_env_variables_values(
1086
1093
  self, env_var_to_value: t.Dict[str, t.Any], except_if_undefined: bool = False