|
1 |
| -import time |
2 | 1 | from typing import Optional, TYPE_CHECKING, Sequence
|
3 | 2 |
|
4 | 3 | from bittensor.core.errors import StakeError, NotRegisteredError
|
@@ -233,7 +232,7 @@ def add_stake_multiple_extrinsic(
|
233 | 232 | total_staking_rao = sum(
|
234 | 233 | [amount.rao if amount is not None else 0 for amount in new_amounts]
|
235 | 234 | )
|
236 |
| - old_balance = inital_balance = subtensor.get_balance( |
| 235 | + old_balance = initial_balance = subtensor.get_balance( |
237 | 236 | wallet.coldkeypub.ss58_address, block=block
|
238 | 237 | )
|
239 | 238 | if total_staking_rao == 0:
|
@@ -298,20 +297,6 @@ def add_stake_multiple_extrinsic(
|
298 | 297 | if staking_response is True: # If we successfully staked.
|
299 | 298 | # We only wait here if we expect finalization.
|
300 | 299 |
|
301 |
| - if idx < len(hotkey_ss58s) - 1: |
302 |
| - # Wait for tx rate limit. |
303 |
| - tx_query = subtensor.substrate.query( |
304 |
| - module="SubtensorModule", storage_function="TxRateLimit" |
305 |
| - ) |
306 |
| - tx_rate_limit_blocks: int = getattr(tx_query, "value", 0) |
307 |
| - if tx_rate_limit_blocks > 0: |
308 |
| - logging.error( |
309 |
| - f":hourglass: [yellow]Waiting for tx rate limit: [white]{tx_rate_limit_blocks}[/white] " |
310 |
| - f"blocks[/yellow]" |
311 |
| - ) |
312 |
| - # 12 seconds per block |
313 |
| - time.sleep(tx_rate_limit_blocks * 12) |
314 |
| - |
315 | 300 | if not wait_for_finalization and not wait_for_inclusion:
|
316 | 301 | old_balance -= staking_balance
|
317 | 302 | successful_stakes += 1
|
@@ -365,7 +350,7 @@ def add_stake_multiple_extrinsic(
|
365 | 350 | )
|
366 | 351 | new_balance = subtensor.get_balance(wallet.coldkeypub.ss58_address)
|
367 | 352 | logging.info(
|
368 |
| - f"Balance: [blue]{inital_balance}[/blue] :arrow_right: [green]{new_balance}[/green]" |
| 353 | + f"Balance: [blue]{initial_balance}[/blue] :arrow_right: [green]{new_balance}[/green]" |
369 | 354 | )
|
370 | 355 | return True
|
371 | 356 |
|
|
0 commit comments