Skip to content

Commit 6ee34dd

Browse files
author
Roman
committed
add async extrinsic
1 parent 7105038 commit 6ee34dd

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

bittensor/core/extrinsics/asyncex/registration.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,20 +498,24 @@ async def set_subnet_identity_extrinsic(
498498
},
499499
)
500500

501-
success, message = await subtensor.sign_and_send_extrinsic(
501+
response = await subtensor.substrate.submit_extrinsic(
502502
call=call,
503503
wallet=wallet,
504504
wait_for_inclusion=wait_for_inclusion,
505505
wait_for_finalization=wait_for_finalization,
506506
)
507507

508-
if success:
508+
if not wait_for_finalization and not wait_for_inclusion:
509+
return True, f"Identities for subnet {netuid} are sent to the chain."
510+
511+
if await response.is_success:
509512
logging.success(
510513
f":white_heavy_check_mark: [green]Identities for subnet[/green] [blue]{netuid}[/blue] [green]are set.[/green]"
511514
)
512515
return True, f"Identities for subnet {netuid} are set."
513516
else:
517+
error_message = await response.error_message
514518
logging.error(
515-
f":cross_mark: Failed to set identity for subnet [blue]{netuid}[/blue]: {message}"
519+
f":cross_mark: Failed to set identity for subnet [blue]{netuid}[/blue]: {error_message}"
516520
)
517-
return False, f"Failed to set identity for subnet {netuid}: {message}"
521+
return False, f"Failed to set identity for subnet {netuid}: {error_message}"

0 commit comments

Comments
 (0)