olas-operate-middleware 0.10.1__py3-none-any.whl → 0.10.2__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,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: olas-operate-middleware
3
- Version: 0.10.1
3
+ Version: 0.10.2
4
4
  Summary:
5
5
  Author: David Vilela
6
6
  Author-email: dvilelaf@gmail.com
@@ -53,7 +53,7 @@ operate/data/contracts/uniswap_v2_erc20/contract.py,sha256=MwBks4QmZ3XouMT_TqWLn
53
53
  operate/data/contracts/uniswap_v2_erc20/contract.yaml,sha256=XUdz-XtKtmZgLfItbO8usP-QPbtUkAxKGn0hL7OftAg,741
54
54
  operate/data/contracts/uniswap_v2_erc20/tests/__init__.py,sha256=3Arw8dsCsJz6hVOl0t9UjFASHXbV9yp3hw6x4HqgXpU,847
55
55
  operate/data/contracts/uniswap_v2_erc20/tests/test_contract.py,sha256=FzZbw9OTcr_yvjOXpk9YcO-K40eyDARyybcfSHDg2Ps,13392
56
- operate/keys.py,sha256=y8QMQcKOqvL62egbJyX6FgFgnxdT3tbxHrRVCmWXJMI,4371
56
+ operate/keys.py,sha256=JdnFFbzBOe9t4eS7i72EShOe25OkQdzRm_asCQHmmH0,4944
57
57
  operate/ledger/__init__.py,sha256=ksyctDd5PU_SToN9e-_N9fAap9ZNCHw48j5hHep-erA,3353
58
58
  operate/ledger/profiles.py,sha256=fQ9vqnXCIBZa3VHZKIvrJ-Jhn_SckFUcPC94JM5brQ8,12343
59
59
  operate/migration.py,sha256=YIJ9P8CdW2IsMm4gW9GdAJ7EKMnUfUMUB5TItiQ0dH8,15323
@@ -66,7 +66,7 @@ operate/quickstart/claim_staking_rewards.py,sha256=AqfLMRef2YijQtWPaTuGwX2sOItNE
66
66
  operate/quickstart/reset_configs.py,sha256=ipPpbYyB9gQ4KOKS-xBrRi8fT5LvwctSkQi-8XiUMig,3341
67
67
  operate/quickstart/reset_password.py,sha256=p_gNmhWD4hb-QXUAiQRalPtVTVyB5TEPhs7GnScYzqs,2535
68
68
  operate/quickstart/reset_staking.py,sha256=GLGUzSz6H_5lUXb9j9jFrgni_vtDXnWpPKK53favXbg,5077
69
- operate/quickstart/run_service.py,sha256=fKeHtEiRmOg5wt3skKvKpxHhO-u-fpoF7_5YUnAM9Sg,27224
69
+ operate/quickstart/run_service.py,sha256=6opWEeedraCsPb6jEd44oV34jVQZJSNH8WOr-Kmo2LM,27116
70
70
  operate/quickstart/stop_service.py,sha256=gyLgPNG6IkI6eyRkIVWEVo9p15hLJyZouFPEVCK2t6I,2036
71
71
  operate/quickstart/terminate_on_chain_service.py,sha256=5ENU8_mkj06i80lKUX-v1QbLU0YzKeOZDUL1e_jzySE,2914
72
72
  operate/quickstart/utils.py,sha256=rmd9e7whQIsYpRKqWBEQxMA_SHrivBg6DppFY5ECtQQ,9135
@@ -86,8 +86,8 @@ operate/utils/gnosis.py,sha256=CS07ZqvrO7uelkFe09VMyPBcLzKONUI1ZqFvi41BDhc,17924
86
86
  operate/utils/ssl.py,sha256=O5DrDoZD4T4qQuHP8GLwWUVxQ-1qXeefGp6uDJiF2lM,4308
87
87
  operate/wallet/__init__.py,sha256=NGiozD3XhvkBi7_FaOWQ8x1thZPK4uGpokJaeDY_o2w,813
88
88
  operate/wallet/master.py,sha256=MGXynIV0LQU3n28AceK7RlaxAtfsVowsXzisesG4iJM,30760
89
- olas_operate_middleware-0.10.1.dist-info/LICENSE,sha256=mdBDB-mWKV5Cz4ejBzBiKqan6Z8zVLAh9xwM64O2FW4,11339
90
- olas_operate_middleware-0.10.1.dist-info/METADATA,sha256=-wfA1j-OSW-M2y-jxSEYO0lEHq8czpmQB2wcgF6pnc4,2034
91
- olas_operate_middleware-0.10.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
92
- olas_operate_middleware-0.10.1.dist-info/entry_points.txt,sha256=dM1g2I7ODApKQFcgl5J4NGA7pfBTo6qsUTXM-j2OLlw,44
93
- olas_operate_middleware-0.10.1.dist-info/RECORD,,
89
+ olas_operate_middleware-0.10.2.dist-info/LICENSE,sha256=mdBDB-mWKV5Cz4ejBzBiKqan6Z8zVLAh9xwM64O2FW4,11339
90
+ olas_operate_middleware-0.10.2.dist-info/METADATA,sha256=iAiNiOd6z_2UBlOwzgIZ_iXWw7C9iaHhQrVICBZv7tU,2034
91
+ olas_operate_middleware-0.10.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
92
+ olas_operate_middleware-0.10.2.dist-info/entry_points.txt,sha256=dM1g2I7ODApKQFcgl5J4NGA7pfBTo6qsUTXM-j2OLlw,44
93
+ olas_operate_middleware-0.10.2.dist-info/RECORD,,
operate/keys.py CHANGED
@@ -63,10 +63,7 @@ class KeysManager(metaclass=SingletonMeta):
63
63
 
64
64
  self.path = kwargs["path"]
65
65
  self.logger = kwargs["logger"]
66
-
67
- def setup(self) -> None:
68
- """Setup service manager."""
69
- self.path.mkdir(exist_ok=True)
66
+ self.path.mkdir(exist_ok=True, parents=True)
70
67
 
71
68
  def get(self, key: str) -> Key:
72
69
  """Get key object."""
@@ -88,15 +85,31 @@ class KeysManager(metaclass=SingletonMeta):
88
85
  )
89
86
  )
90
87
  )
91
- with tempfile.NamedTemporaryFile(mode="w", suffix=".txt") as temp_file:
88
+ # Create temporary file with delete=False to handle it manually
89
+ with tempfile.NamedTemporaryFile(
90
+ dir=self.path,
91
+ mode="w",
92
+ suffix=".txt",
93
+ delete=False, # Handle cleanup manually
94
+ ) as temp_file:
92
95
  temp_file.write(key.private_key)
93
96
  temp_file.flush()
97
+ temp_file.close() # Close the file before reading
98
+
99
+ # Set proper file permissions (readable by owner only)
100
+ os.chmod(temp_file.name, 0o600)
94
101
  crypto = EthereumCrypto(private_key_path=temp_file.name)
95
102
 
103
+ try:
104
+ os.unlink(temp_file.name) # Clean up the temporary file
105
+ except OSError as e:
106
+ self.logger.error(f"Failed to delete temp file {temp_file.name}: {e}")
107
+
96
108
  return crypto
97
109
 
98
110
  def create(self) -> str:
99
111
  """Creates new key."""
112
+ self.path.mkdir(exist_ok=True, parents=True)
100
113
  crypto = EthereumCrypto()
101
114
  for path in (
102
115
  self.path / f"{crypto.address}.bak",
@@ -665,8 +665,6 @@ def run_service(
665
665
 
666
666
  print_title(f"{template['name']} quickstart")
667
667
 
668
- operate.service_manager().migrate_service_configs()
669
- operate.wallet_manager.migrate_wallet_configs()
670
668
  ask_password_if_needed(operate)
671
669
  _maybe_create_master_eoa(operate)
672
670