Skip to content

Commit

Permalink
Remove process_events() calls if they precede is_success (which pro…
Browse files Browse the repository at this point in the history
…cesses the events anyway)
  • Loading branch information
thewhaleking committed Dec 16, 2024
1 parent 4a8d06f commit 0bf40c7
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 12 deletions.
1 change: 0 additions & 1 deletion bittensor/core/async_subtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,6 @@ async def sign_and_send_extrinsic(
# We only wait here if we expect finalization.
if not wait_for_finalization and not wait_for_inclusion:
return True, ""
await response.process_events()
if await response.is_success:
return True, ""
else:
Expand Down
1 change: 0 additions & 1 deletion bittensor/core/extrinsics/async_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ async def _do_pow_register(
return True, None

# process if registration successful, try again if pow is still valid
await response.process_events()
if not await response.is_success:
return False, format_error_message(error_message=await response.error_message)
# Successful registration
Expand Down
1 change: 0 additions & 1 deletion bittensor/core/extrinsics/async_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ async def _do_set_root_weights(
if not wait_for_finalization and not wait_for_inclusion:
return True, "Not waiting for finalization or inclusion."

await response.process_events()
if await response.is_success:
return True, "Successfully set weights."
else:
Expand Down
1 change: 0 additions & 1 deletion bittensor/core/extrinsics/async_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ async def _do_transfer(
return True, "", "Success, extrinsic submitted without waiting."

# Otherwise continue with finalization.
await response.process_events()
if await response.is_success:
block_hash_ = response.block_hash
return True, block_hash_, "Success with response."
Expand Down
2 changes: 0 additions & 2 deletions bittensor/core/extrinsics/async_weights.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ async def _do_set_weights(
if not wait_for_finalization and not wait_for_inclusion:
return True, "Not waiting for finalization or inclusion."

await response.process_events()
if await response.is_success:
return True, "Successfully set weights."
else:
Expand Down Expand Up @@ -200,7 +199,6 @@ async def _do_commit_weights(
if not wait_for_finalization and not wait_for_inclusion:
return True, None

await response.process_events()
if await response.is_success:
return True, None
else:
Expand Down
5 changes: 1 addition & 4 deletions bittensor/core/extrinsics/commit_reveal.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,10 @@ def _do_commit_reveal_v3(
if not wait_for_finalization and not wait_for_inclusion:
return True, "Not waiting for finalization or inclusion."

response.process_events()
if response.is_success:
return True, None
else:
return False, format_error_message(
response.error_message
)
return False, format_error_message(response.error_message)


def commit_reveal_v3_extrinsic(
Expand Down
1 change: 0 additions & 1 deletion bittensor/core/extrinsics/staking.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def _do_stake(
if not wait_for_finalization and not wait_for_inclusion:
return True

response.process_events()
if response.is_success:
return True
else:
Expand Down
1 change: 0 additions & 1 deletion bittensor/core/extrinsics/unstaking.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def _do_unstake(
if not wait_for_finalization and not wait_for_inclusion:
return True

response.process_events()
if response.is_success:
return True
else:
Expand Down

0 comments on commit 0bf40c7

Please sign in to comment.