Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Py-Substrate-Interface class entirely #47

Merged
merged 42 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
8deebc9
[WIP] Check-in
thewhaleking Sep 3, 2024
1fa2c33
[WIP] Check-in
thewhaleking Sep 3, 2024
af58b3b
[WIP] Check-in
thewhaleking Sep 3, 2024
d44cb10
[WIP] Updated docstring
thewhaleking Sep 3, 2024
90c8a1f
[WIP] Check-in
thewhaleking Sep 4, 2024
2656e86
[WIP] Check-in
thewhaleking Sep 4, 2024
172a771
[WIP] Check-in
thewhaleking Sep 4, 2024
d0a4b17
[WIP] Check-in
thewhaleking Sep 4, 2024
2ef740b
[WIP] Check-in
thewhaleking Sep 4, 2024
46784c3
[WIP] Check-in
thewhaleking Sep 4, 2024
f3d0b5a
[WIP] Check-in
thewhaleking Sep 4, 2024
c8368bf
Progress (maybe)
thewhaleking Sep 4, 2024
b2413e4
Progress
thewhaleking Sep 5, 2024
321228a
In the arena, trying things.
thewhaleking Sep 6, 2024
7382cae
[WIP] checking
thewhaleking Sep 9, 2024
0221a4a
Working decoder (using bt-decode `feat/decode-by-type-string` branch)
thewhaleking Sep 9, 2024
0e18782
Fix validator_trust
thewhaleking Sep 9, 2024
c8431fe
[WIP] check-in, handle Runtime warning when connection fails.
thewhaleking Sep 10, 2024
af5722f
[WIP] check-in
thewhaleking Sep 10, 2024
bbeed4d
[WIP] check-in
thewhaleking Sep 10, 2024
e7a4192
More progress.
thewhaleking Sep 10, 2024
b9df070
[WIP] Check-in
thewhaleking Sep 11, 2024
ae1bd84
Working.
thewhaleking Sep 11, 2024
6c9ced8
Progress.
thewhaleking Sep 11, 2024
65e5c1f
All tests passing
thewhaleking Sep 12, 2024
53d36a3
Cleanup
thewhaleking Sep 12, 2024
24594dd
Cleanup
thewhaleking Sep 12, 2024
5f9d28b
Fixed kwargs
thewhaleking Sep 12, 2024
24f860a
Fixed votes/proposals
thewhaleking Sep 12, 2024
2be003a
Adds support for Python 3.9
ibraheem-opentensor Sep 12, 2024
8435e55
bt-decode version
thewhaleking Sep 12, 2024
4793cbf
Moved enumerating logic to after setting default my_weights
thewhaleking Sep 12, 2024
e304189
Remove .value as item directly returns int
thewhaleking Sep 12, 2024
b06b0a9
Fixes
thewhaleking Sep 12, 2024
5dc2141
Fixes
thewhaleking Sep 13, 2024
011c2e0
Error handling
thewhaleking Sep 13, 2024
b88df55
Update proposals and senate members retrieval
thewhaleking Sep 16, 2024
24034ad
Fix showing difference.
thewhaleking Sep 16, 2024
0ed502e
PGP Fingerprint
thewhaleking Sep 16, 2024
cad64f2
PGP Fingerprint
thewhaleking Sep 16, 2024
3f0b5ad
Type fix
thewhaleking Sep 16, 2024
fa4163d
PGP
thewhaleking Sep 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions bittensor_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import curses
import os.path
import re
import sys
from pathlib import Path
from typing import Coroutine, Optional

Expand Down Expand Up @@ -141,10 +142,10 @@ class Options:
prompt=True,
)
weights = typer.Option(
[],
"--weights",
"-w",
help="Corresponding weights for the specified UIDs, e.g. `-w 0.2 -w 0.4 -w 0.1 ...",
[],
"--weights",
"-w",
help="Corresponding weights for the specified UIDs, e.g. `-w 0.2 -w 0.4 -w 0.1 ...",
)
reuse_last = typer.Option(
False,
Expand Down Expand Up @@ -653,22 +654,28 @@ def _run_command(self, cmd: Coroutine) -> None:
"""

async def _run():
if self.not_subtensor:
async with self.not_subtensor:
try:
if self.not_subtensor:
async with self.not_subtensor:
await cmd
else:
await cmd
else:
await cmd
except ConnectionRefusedError:
err_console.print(f"Unable to connect to chain: {self.not_subtensor}")
asyncio.create_task(cmd).cancel()
raise typer.Exit()
except ConnectionClosed:
raise typer.Exit()
except SubstrateRequestException as e:
err_console.print(str(e))
raise typer.Exit()

try:
if sys.version_info < (3, 10):
# For Python 3.9 or lower
return asyncio.get_event_loop().run_until_complete(_run())
else:
# For Python 3.10 or higher
return asyncio.run(_run())
except ConnectionRefusedError:
err_console.print(
f"Connection refused when connecting to chain: {self.not_subtensor}"
)
except ConnectionClosed:
pass
except SubstrateRequestException as e:
err_console.print(str(e))

def main_callback(
self,
Expand Down
Loading
Loading