Skip to content

Commit 0bf40c7

Browse files
committed
Remove process_events() calls if they precede is_success (which processes the events anyway)
1 parent 4a8d06f commit 0bf40c7

File tree

8 files changed

+1
-12
lines changed

8 files changed

+1
-12
lines changed

bittensor/core/async_subtensor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,6 @@ async def sign_and_send_extrinsic(
14161416
# We only wait here if we expect finalization.
14171417
if not wait_for_finalization and not wait_for_inclusion:
14181418
return True, ""
1419-
await response.process_events()
14201419
if await response.is_success:
14211420
return True, ""
14221421
else:

bittensor/core/extrinsics/async_registration.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ async def _do_pow_register(
8383
return True, None
8484

8585
# process if registration successful, try again if pow is still valid
86-
await response.process_events()
8786
if not await response.is_success:
8887
return False, format_error_message(error_message=await response.error_message)
8988
# Successful registration

bittensor/core/extrinsics/async_root.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ async def _do_set_root_weights(
167167
if not wait_for_finalization and not wait_for_inclusion:
168168
return True, "Not waiting for finalization or inclusion."
169169

170-
await response.process_events()
171170
if await response.is_success:
172171
return True, "Successfully set weights."
173172
else:

bittensor/core/extrinsics/async_transfer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ async def _do_transfer(
5656
return True, "", "Success, extrinsic submitted without waiting."
5757

5858
# Otherwise continue with finalization.
59-
await response.process_events()
6059
if await response.is_success:
6160
block_hash_ = response.block_hash
6261
return True, block_hash_, "Success with response."

bittensor/core/extrinsics/async_weights.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ async def _do_set_weights(
7373
if not wait_for_finalization and not wait_for_inclusion:
7474
return True, "Not waiting for finalization or inclusion."
7575

76-
await response.process_events()
7776
if await response.is_success:
7877
return True, "Successfully set weights."
7978
else:
@@ -200,7 +199,6 @@ async def _do_commit_weights(
200199
if not wait_for_finalization and not wait_for_inclusion:
201200
return True, None
202201

203-
await response.process_events()
204202
if await response.is_success:
205203
return True, None
206204
else:

bittensor/core/extrinsics/commit_reveal.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,10 @@ def _do_commit_reveal_v3(
6868
if not wait_for_finalization and not wait_for_inclusion:
6969
return True, "Not waiting for finalization or inclusion."
7070

71-
response.process_events()
7271
if response.is_success:
7372
return True, None
7473
else:
75-
return False, format_error_message(
76-
response.error_message
77-
)
74+
return False, format_error_message(response.error_message)
7875

7976

8077
def commit_reveal_v3_extrinsic(

bittensor/core/extrinsics/staking.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def _do_stake(
5353
if not wait_for_finalization and not wait_for_inclusion:
5454
return True
5555

56-
response.process_events()
5756
if response.is_success:
5857
return True
5958
else:

bittensor/core/extrinsics/unstaking.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def _do_unstake(
5252
if not wait_for_finalization and not wait_for_inclusion:
5353
return True
5454

55-
response.process_events()
5655
if response.is_success:
5756
return True
5857
else:

0 commit comments

Comments
 (0)