Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bittensor/core/async_subtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5681,6 +5681,7 @@ async def sign_and_send_extrinsic(
sign_with: str = "coldkey",
use_nonce: bool = False,
nonce_key: str = "hotkey",
nonce: Optional[int] = None,
period: Optional[int] = DEFAULT_PERIOD,
raise_error: bool = False,
wait_for_inclusion: bool = True,
Expand Down Expand Up @@ -5722,7 +5723,9 @@ async def sign_and_send_extrinsic(
)
signing_keypair = getattr(wallet, sign_with)
extrinsic_data = {"call": call, "keypair": signing_keypair}
if use_nonce:
if nonce is not None:
extrinsic_data["nonce"] = nonce
elif use_nonce:
if nonce_key not in possible_keys:
raise AttributeError(
f"'nonce_key' must be either 'coldkey', 'hotkey' or 'coldkeypub', not '{nonce_key}'"
Expand Down
6 changes: 5 additions & 1 deletion bittensor/core/extrinsics/asyncex/mev_shield.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,12 @@ async def submit_encrypted_extrinsic(
current_nonce = await subtensor.substrate.get_account_next_index(
account_address=inner_signing_keypair.ss58_address
)
next_nonce = await subtensor.substrate.get_account_next_index(
account_address=inner_signing_keypair.ss58_address
)

signed_extrinsic = await subtensor.substrate.create_signed_extrinsic(
call=call, keypair=inner_signing_keypair, nonce=current_nonce + 1, era=era
call=call, keypair=inner_signing_keypair, nonce=next_nonce, era=era
)

mev_commitment, mev_ciphertext, payload_core = (
Expand All @@ -204,6 +207,7 @@ async def submit_encrypted_extrinsic(
sign_with=sign_with,
call=extrinsic_call,
period=period,
nonce=current_nonce,
raise_error=raise_error,
wait_for_inclusion=wait_for_inclusion,
wait_for_finalization=wait_for_finalization,
Expand Down