hippius 0.2.33__tar.gz → 0.2.34__tar.gz
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.
- {hippius-0.2.33 → hippius-0.2.34}/PKG-INFO +1 -1
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/__init__.py +1 -1
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/cli_handlers.py +12 -32
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/substrate.py +11 -0
- {hippius-0.2.33 → hippius-0.2.34}/pyproject.toml +1 -1
- {hippius-0.2.33 → hippius-0.2.34}/README.md +0 -0
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/cli.py +0 -0
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/cli_assets.py +0 -0
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/cli_parser.py +0 -0
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/cli_rich.py +0 -0
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/client.py +0 -0
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/config.py +0 -0
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/db/README.md +0 -0
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/db/env.db.template +0 -0
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/db/migrations/20241201000001_create_key_storage_tables.sql +0 -0
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/db/migrations/20241202000001_switch_to_subaccount_encryption.sql +0 -0
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/db/setup_database.sh +0 -0
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/db_utils.py +0 -0
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/errors.py +0 -0
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/ipfs.py +0 -0
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/ipfs_core.py +0 -0
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/key_storage.py +0 -0
- {hippius-0.2.33 → hippius-0.2.34}/hippius_sdk/utils.py +0 -0
@@ -26,7 +26,7 @@ from hippius_sdk.config import (
|
|
26
26
|
from hippius_sdk.ipfs import IPFSClient, S3PublishResult, S3DownloadResult
|
27
27
|
from hippius_sdk.utils import format_cid, format_size, hex_to_ipfs_cid
|
28
28
|
|
29
|
-
__version__ = "0.2.
|
29
|
+
__version__ = "0.2.34"
|
30
30
|
__all__ = [
|
31
31
|
"HippiusClient",
|
32
32
|
"IPFSClient",
|
@@ -130,9 +130,7 @@ def create_client(args: Any) -> HippiusClient:
|
|
130
130
|
):
|
131
131
|
needs_password = True
|
132
132
|
# Special case for pin - only needs password if we're publishing
|
133
|
-
elif command == "pin" and not (
|
134
|
-
hasattr(args, "no_publish") and args.no_publish
|
135
|
-
):
|
133
|
+
elif command == "pin" and not (hasattr(args, "no_publish") and args.no_publish):
|
136
134
|
needs_password = True
|
137
135
|
|
138
136
|
# If this command doesn't need password access, set to empty string to skip prompting
|
@@ -1258,35 +1256,17 @@ async def handle_erasure_code(
|
|
1258
1256
|
)
|
1259
1257
|
return 1
|
1260
1258
|
|
1261
|
-
#
|
1262
|
-
if
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
warning("Wallet password will be required for publishing to blockchain")
|
1273
|
-
password = getpass.getpass(
|
1274
|
-
"Enter password to decrypt seed phrase: \n\n"
|
1275
|
-
)
|
1276
|
-
|
1277
|
-
# Store the password in client for later use
|
1278
|
-
client.substrate_client._seed_phrase_password = password
|
1279
|
-
|
1280
|
-
# Pre-authenticate to ensure the password is correct
|
1281
|
-
try:
|
1282
|
-
seed_phrase = decrypt_seed_phrase(password, account_name)
|
1283
|
-
if not seed_phrase:
|
1284
|
-
error("Failed to decrypt seed phrase. Incorrect password?")
|
1285
|
-
return 1
|
1286
|
-
client.substrate_client._seed_phrase = seed_phrase
|
1287
|
-
except Exception as e:
|
1288
|
-
error(f"Error decrypting seed phrase: {e}")
|
1289
|
-
return 1
|
1259
|
+
# If publishing is enabled, ensure we have a valid substrate client by accessing it
|
1260
|
+
# This will trigger password prompts if needed right at the beginning
|
1261
|
+
if publish and hasattr(client, "substrate_client") and client.substrate_client:
|
1262
|
+
try:
|
1263
|
+
# Force keypair initialization - this will prompt for password if needed
|
1264
|
+
_ = client.substrate_client._ensure_keypair()
|
1265
|
+
except Exception as e:
|
1266
|
+
warning(f"Failed to initialize blockchain client: {str(e)}")
|
1267
|
+
warning(
|
1268
|
+
"Will continue with erasure coding but blockchain publishing may fail"
|
1269
|
+
)
|
1290
1270
|
|
1291
1271
|
# Get file size
|
1292
1272
|
file_size = os.path.getsize(file_path)
|
@@ -165,6 +165,17 @@ class SubstrateClient:
|
|
165
165
|
)
|
166
166
|
return False
|
167
167
|
|
168
|
+
# Check if we have a pre-stored seed phrase first
|
169
|
+
if self._seed_phrase:
|
170
|
+
try:
|
171
|
+
self._keypair = Keypair.create_from_mnemonic(self._seed_phrase)
|
172
|
+
self._account_address = self._keypair.ss58_address
|
173
|
+
self._read_only = False
|
174
|
+
return True
|
175
|
+
except Exception as e:
|
176
|
+
print(f"Warning: Could not create keypair from stored seed phrase: {e}")
|
177
|
+
# Fall through to try config
|
178
|
+
|
168
179
|
# Otherwise, try to get the seed phrase from config
|
169
180
|
config_seed = get_seed_phrase(self._seed_phrase_password, self._account_name)
|
170
181
|
if config_seed:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|