cartha-cli 1.0.3__py3-none-any.whl → 1.0.5__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.
- cartha_cli/commands/prove_lock.py +39 -27
- {cartha_cli-1.0.3.dist-info → cartha_cli-1.0.5.dist-info}/METADATA +1 -1
- {cartha_cli-1.0.3.dist-info → cartha_cli-1.0.5.dist-info}/RECORD +6 -6
- {cartha_cli-1.0.3.dist-info → cartha_cli-1.0.5.dist-info}/WHEEL +0 -0
- {cartha_cli-1.0.3.dist-info → cartha_cli-1.0.5.dist-info}/entry_points.txt +0 -0
- {cartha_cli-1.0.3.dist-info → cartha_cli-1.0.5.dist-info}/licenses/LICENSE +0 -0
|
@@ -381,26 +381,31 @@ def prove_lock(
|
|
|
381
381
|
if chain is None:
|
|
382
382
|
# Try to get chain ID from pool ID first
|
|
383
383
|
auto_chain_id = None
|
|
384
|
+
# Ensure pool_id is properly formatted (lowercase, with 0x prefix)
|
|
385
|
+
pool_id_normalized = pool_id.lower().strip()
|
|
386
|
+
if not pool_id_normalized.startswith("0x"):
|
|
387
|
+
pool_id_normalized = "0x" + pool_id_normalized
|
|
388
|
+
|
|
384
389
|
try:
|
|
385
|
-
auto_chain_id = pool_id_to_chain_id(
|
|
386
|
-
except NameError:
|
|
390
|
+
auto_chain_id = pool_id_to_chain_id(pool_id_normalized)
|
|
391
|
+
except (NameError, AttributeError, TypeError):
|
|
387
392
|
# Function not available - this shouldn't happen if imports worked
|
|
388
393
|
# But handle gracefully by trying to import it
|
|
389
394
|
try:
|
|
390
|
-
from testnet.pool_ids import pool_id_to_chain_id
|
|
391
|
-
auto_chain_id = pool_id_to_chain_id(
|
|
392
|
-
except ImportError:
|
|
395
|
+
from ..testnet.pool_ids import pool_id_to_chain_id
|
|
396
|
+
auto_chain_id = pool_id_to_chain_id(pool_id_normalized)
|
|
397
|
+
except (ImportError, ModuleNotFoundError, TypeError):
|
|
393
398
|
pass
|
|
394
399
|
|
|
395
400
|
if not auto_chain_id:
|
|
396
401
|
# Fallback: try to get from vault address
|
|
397
402
|
try:
|
|
398
403
|
auto_chain_id = vault_address_to_chain_id(vault)
|
|
399
|
-
except NameError:
|
|
404
|
+
except (NameError, AttributeError, TypeError):
|
|
400
405
|
try:
|
|
401
|
-
from testnet.pool_ids import vault_address_to_chain_id
|
|
406
|
+
from ..testnet.pool_ids import vault_address_to_chain_id
|
|
402
407
|
auto_chain_id = vault_address_to_chain_id(vault)
|
|
403
|
-
except ImportError:
|
|
408
|
+
except (ImportError, ModuleNotFoundError, TypeError):
|
|
404
409
|
pass
|
|
405
410
|
|
|
406
411
|
if auto_chain_id:
|
|
@@ -410,32 +415,39 @@ def prove_lock(
|
|
|
410
415
|
f"[bold green]✓ Auto-matched chain ID[/] - {chain_name} (chain ID: {chain})"
|
|
411
416
|
)
|
|
412
417
|
else:
|
|
413
|
-
# Fallback:
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
418
|
+
# Fallback: if on testnet and we have a vault, default to Base Sepolia (84532)
|
|
419
|
+
if network == "test" and vault:
|
|
420
|
+
chain = 84532
|
|
421
|
+
console.print(
|
|
422
|
+
f"[bold green]✓ Auto-matched chain ID[/] - Base Sepolia (chain ID: 84532) [dim](testnet default)[/]"
|
|
423
|
+
)
|
|
424
|
+
else:
|
|
425
|
+
# Prompt for chain ID if no mapping found
|
|
426
|
+
console.print(
|
|
427
|
+
"[yellow]⚠ No chain ID mapping found. Please provide chain ID.[/]"
|
|
428
|
+
)
|
|
429
|
+
while True:
|
|
430
|
+
try:
|
|
431
|
+
chain_input = typer.prompt("Chain ID", show_default=False)
|
|
432
|
+
chain = int(chain_input)
|
|
433
|
+
if chain <= 0:
|
|
434
|
+
console.print(
|
|
435
|
+
"[bold red]Error:[/] Chain ID must be a positive integer"
|
|
436
|
+
)
|
|
437
|
+
continue
|
|
438
|
+
break
|
|
439
|
+
except ValueError:
|
|
440
|
+
console.print("[bold red]Error:[/] Chain ID must be a valid integer")
|
|
429
441
|
else:
|
|
430
442
|
# Chain ID was provided, verify it matches vault if possible
|
|
431
443
|
expected_chain_id = None
|
|
432
444
|
try:
|
|
433
445
|
expected_chain_id = vault_address_to_chain_id(vault)
|
|
434
|
-
except NameError:
|
|
446
|
+
except (NameError, AttributeError):
|
|
435
447
|
try:
|
|
436
|
-
from testnet.pool_ids import vault_address_to_chain_id
|
|
448
|
+
from ..testnet.pool_ids import vault_address_to_chain_id
|
|
437
449
|
expected_chain_id = vault_address_to_chain_id(vault)
|
|
438
|
-
except ImportError:
|
|
450
|
+
except (ImportError, ModuleNotFoundError):
|
|
439
451
|
pass
|
|
440
452
|
|
|
441
453
|
if expected_chain_id and expected_chain_id != chain:
|
|
@@ -17,15 +17,15 @@ cartha_cli/commands/miner_password.py,sha256=7cbcyrJ9KzCyJ68_174U_CXjBUt9BaYhgKA
|
|
|
17
17
|
cartha_cli/commands/miner_status.py,sha256=tWlCWcuwm9NEd4USuCLp_6qObikX2odc2e7m6Y_vNrU,21873
|
|
18
18
|
cartha_cli/commands/pair_status.py,sha256=LoU-fA1MXuWZGHNmeKPMjwvNw30Yn094ZD1EC0-WXVc,19978
|
|
19
19
|
cartha_cli/commands/pools.py,sha256=P02SEp23a7OdrgNj6AaiJTnQ9K_QrI300DzucA6HH8A,3884
|
|
20
|
-
cartha_cli/commands/prove_lock.py,sha256=
|
|
20
|
+
cartha_cli/commands/prove_lock.py,sha256=FkurHtL2i2891ACEV1TejTAgkutIV1grykatx0W-JCI,61168
|
|
21
21
|
cartha_cli/commands/register.py,sha256=sxbYO0V4NucOKLZpaFoVnhFDHLSLDHREoMtN9DjyLsM,10227
|
|
22
22
|
cartha_cli/commands/shared_options.py,sha256=itHzJSgxuKQxUVOh1_jVTcMQXjI3PPzexQyhqIbabxc,5874
|
|
23
23
|
cartha_cli/commands/version.py,sha256=u5oeccQzK0LLcCbgZm0U8-Vslk5vB_lVvW3xT5HPeTg,456
|
|
24
24
|
cartha_cli/testnet/README.md,sha256=kWKaLtq6t_46W-mvXkSaLi2fjXDELLk5ntVGkogiUY0,14511
|
|
25
25
|
cartha_cli/testnet/__init__.py,sha256=xreJMXs-ZKTkPtUQBR5xdY7ImOyUiF7WKG6bv9J9aBM,41
|
|
26
26
|
cartha_cli/testnet/pool_ids.py,sha256=0jvQ6tvc6sL0aGKkl31KXM6ngVpUboYiABY5SDMaRCQ,6747
|
|
27
|
-
cartha_cli-1.0.
|
|
28
|
-
cartha_cli-1.0.
|
|
29
|
-
cartha_cli-1.0.
|
|
30
|
-
cartha_cli-1.0.
|
|
31
|
-
cartha_cli-1.0.
|
|
27
|
+
cartha_cli-1.0.5.dist-info/METADATA,sha256=CpmQxsTilpHMwpDu5xlNnWyU0baoAJkGWAnFOO05eEE,5794
|
|
28
|
+
cartha_cli-1.0.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
29
|
+
cartha_cli-1.0.5.dist-info/entry_points.txt,sha256=sTYVMgb9l0fuJibUtWpGnIoDmgHinne97G4Y_cCwC-U,43
|
|
30
|
+
cartha_cli-1.0.5.dist-info/licenses/LICENSE,sha256=B4UCiDn13m4xYwIl4TMKfbuKw7kh9pg4c81rJecxHSo,1076
|
|
31
|
+
cartha_cli-1.0.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|