From 17f04527fb103d7e6baec49162d7c5e456bb8e27 Mon Sep 17 00:00:00 2001 From: opendansor Date: Fri, 8 Nov 2024 10:45:05 -0800 Subject: [PATCH] Extend period for fastblock e2e tests_incentive.py --- bittensor/core/extrinsics/set_weights.py | 4 +++- tests/e2e_tests/test_incentive.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bittensor/core/extrinsics/set_weights.py b/bittensor/core/extrinsics/set_weights.py index bb7950809..f18179f8c 100644 --- a/bittensor/core/extrinsics/set_weights.py +++ b/bittensor/core/extrinsics/set_weights.py @@ -45,6 +45,7 @@ def do_set_weights( version_key: int = version_as_int, wait_for_inclusion: bool = False, wait_for_finalization: bool = False, + period: int = 5, ) -> tuple[bool, Optional[str]]: # (success, error_message) """ Internal method to send a transaction to the Bittensor blockchain, setting weights for specified neurons. This method constructs and submits the transaction, handling retries and blockchain communication. @@ -58,6 +59,7 @@ def do_set_weights( version_key (int): Version key for compatibility with the network. wait_for_inclusion (bool): Waits for the transaction to be included in a block. wait_for_finalization (bool): Waits for the transaction to be finalized on the blockchain. + period (int): Period dictates how long the extrinsic will stay as part of waiting pool. Returns: tuple[bool, Optional[str]]: A tuple containing a success flag and an optional response message. @@ -79,7 +81,7 @@ def do_set_weights( extrinsic = self.substrate.create_signed_extrinsic( call=call, keypair=wallet.hotkey, - era={"period": 5}, + era={"period": period}, ) response = submit_extrinsic( substrate=self.substrate, diff --git a/tests/e2e_tests/test_incentive.py b/tests/e2e_tests/test_incentive.py index a95cf3766..f1b070d88 100644 --- a/tests/e2e_tests/test_incentive.py +++ b/tests/e2e_tests/test_incentive.py @@ -158,6 +158,7 @@ async def test_incentive(local_chain): version_key=0, wait_for_inclusion=True, wait_for_finalization=True, + period=25 ) logging.info("Alice neuron set weights successfully")