You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Executes the commit-reveal phase 3 for a given netuid and commit, and optionally waits for extrinsic inclusion or
30
-
finalization.
30
+
Executes the commit-reveal phase 3 for a given netuid and commit, and optionally waits for extrinsic inclusion or finalization.
31
31
32
32
Arguments:
33
+
subtensor: An instance of the Subtensor class.
33
34
wallet: Wallet An instance of the Wallet class containing the user's keypair.
34
35
netuid: int The network unique identifier.
35
36
commit bytes The commit data in bytes format.
@@ -38,8 +39,7 @@ async def _do_commit_reveal_v3(
38
39
wait_for_finalization: bool, optional Flag indicating whether to wait for the extrinsic to be finalized.
39
40
40
41
Returns:
41
-
A tuple where the first element is a boolean indicating success or failure, and the second element is an
42
-
optional string containing error message if any.
42
+
A tuple where the first element is a boolean indicating success or failure, and the second element is an optional string containing error message if any.
43
43
"""
44
44
logging.info(
45
45
f"Committing weights hash [blue]{commit.hex()}[/blue] for subnet #[blue]{netuid}[/blue] with "
netuid (int): The ``netuid`` of the subnet to register on.
103
+
wait_for_inclusion (bool): If set, waits for the extrinsic to enter a block before returning ``true``, or
104
+
returns ``false`` if the extrinsic fails to enter the block within the timeout.
105
+
wait_for_finalization (bool): If set, waits for the extrinsic to be finalized on the chain before returning
106
+
``true``, or returns ``false`` if the extrinsic fails to be finalized within the timeout.
107
+
108
+
Returns:
109
+
success (bool): Flag is ``true`` if extrinsic was finalized or uncluded in the block. If we did not wait for finalization / inclusion, the response is ``true``.
110
+
"""
111
+
ifnotawaitsubtensor.subnet_exists(netuid):
112
+
logging.error(
113
+
f":cross_mark: [red]Failed error:[/red] subnet [blue]{netuid}[/blue] does not exist."
114
+
)
115
+
returnFalse
116
+
117
+
ifnot (unlock:=unlock_key(wallet)).success:
118
+
logging.error(unlock.message)
119
+
returnFalse
120
+
121
+
logging.info(
122
+
f":satellite: [magenta]Checking Account on subnet[/magenta] [blue]{netuid}[/blue][magenta] ...[/magenta]"
0 commit comments