Skip to content

Commit 4d6ad65

Browse files
Merge branch 'staging' into feat/abe/e2e-tests-1
2 parents 107f421 + bab874c commit 4d6ad65

17 files changed

+737
-317
lines changed

bittensor/core/async_subtensor.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ def __init__(self, network: str = DEFAULT_NETWORK):
132132
self.network = "custom"
133133
else:
134134
logging.info(
135-
f"Network not specified or not valid. Using default chain endpoint: <blue>{NETWORK_MAP[DEFAULTS.subtensor.network]}</blue>."
135+
f"Network not specified or not valid. Using default chain endpoint: [blue]{NETWORK_MAP[DEFAULTS.subtensor.network]}[/blue]."
136136
)
137137
logging.info(
138-
"You can set this for commands with the <blue>--network</blue> flag, or by setting this in the config."
138+
"You can set this for commands with the [blue]--network[/blue] flag, or by setting this in the config."
139139
)
140140
self.chain_endpoint = NETWORK_MAP[DEFAULTS.subtensor.network]
141141
self.network = DEFAULTS.subtensor.network
@@ -152,19 +152,19 @@ def __str__(self):
152152

153153
async def __aenter__(self):
154154
logging.info(
155-
f"<magenta>Connecting to Substrate:</magenta> <blue>{self}</blue><magenta>...</magenta>"
155+
f"[magenta]Connecting to Substrate:[/magenta] [blue]{self}[/blue][magenta]...[/magenta]"
156156
)
157157
try:
158158
async with self.substrate:
159159
return self
160160
except TimeoutException:
161161
logging.error(
162-
f"<red>Error</red>: Timeout occurred connecting to substrate. Verify your chain and network settings: {self}"
162+
f"[red]Error[/red]: Timeout occurred connecting to substrate. Verify your chain and network settings: {self}"
163163
)
164164
raise ConnectionError
165165
except (ConnectionRefusedError, ssl.SSLError) as error:
166166
logging.error(
167-
f"<red>Error</red>: Connection refused when connecting to substrate. "
167+
f"[red]Error[/red]: Connection refused when connecting to substrate. "
168168
f"Verify your chain and network settings: {self}. Error: {error}"
169169
)
170170
raise ConnectionError
@@ -533,7 +533,7 @@ async def get_transfer_fee(
533533
)
534534
except Exception as e:
535535
logging.error(
536-
f":cross_mark: <red>Failed to get payment info: </red>{e}"
536+
f":cross_mark: [red]Failed to get payment info: [/red]{e}"
537537
)
538538
payment_info = {"partialFee": int(2e7)} # assume 0.02 Tao
539539

@@ -1408,7 +1408,7 @@ async def register(
14081408
`True` if registration was successful, otherwise `False`.
14091409
"""
14101410
logging.info(
1411-
f"Registering on netuid <blue>0</blue> on network: <blue>{self.network}</blue>"
1411+
f"Registering on netuid [blue]0[/blue] on network: [blue]{self.network}[/blue]"
14121412
)
14131413

14141414
# Check current recycle amount
@@ -1431,7 +1431,7 @@ async def register(
14311431
# Check balance is sufficient
14321432
if balance < current_recycle:
14331433
logging.error(
1434-
f"<red>Insufficient balance {balance} to register neuron. Current recycle is {current_recycle} TAO</red>."
1434+
f"[red]Insufficient balance {balance} to register neuron. Current recycle is {current_recycle} TAO[/red]."
14351435
)
14361436
return False
14371437

@@ -1509,7 +1509,7 @@ async def set_weights(
15091509
) > await self.weights_rate_limit(netuid):
15101510
try:
15111511
logging.info(
1512-
f"Setting weights for subnet #<blue>{netuid}</blue>. Attempt <blue>{retries + 1} of {max_retries}</blue>."
1512+
f"Setting weights for subnet #[blue]{netuid}[/blue]. Attempt [blue]{retries + 1} of {max_retries}[/blue]."
15131513
)
15141514
success, message = await set_weights_extrinsic(
15151515
subtensor=self,
@@ -1547,7 +1547,7 @@ async def root_set_weights(
15471547
"""
15481548
netuids_ = np.array(netuids, dtype=np.int64)
15491549
weights_ = np.array(weights, dtype=np.float32)
1550-
logging.info(f"Setting weights in network: <blue>{self.network}</blue>")
1550+
logging.info(f"Setting weights in network: [blue]{self.network}[/blue]")
15511551
# Run the set weights operation.
15521552
return await set_root_weights_extrinsic(
15531553
subtensor=self,

0 commit comments

Comments
 (0)