diff --git a/bittensor/core/extrinsics/asyncex/move_stake.py b/bittensor/core/extrinsics/asyncex/move_stake.py index 8cfd5a2604..8ed6a29141 100644 --- a/bittensor/core/extrinsics/asyncex/move_stake.py +++ b/bittensor/core/extrinsics/asyncex/move_stake.py @@ -71,14 +71,6 @@ async def transfer_stake_extrinsic( """ amount.set_unit(netuid=origin_netuid) - # Verify ownership - hotkey_owner = await subtensor.get_hotkey_owner(hotkey_ss58) - if hotkey_owner != wallet.coldkeypub.ss58_address: - logging.error( - f":cross_mark: [red]Failed[/red]: Hotkey: {hotkey_ss58} does not belong to the origin coldkey owner: " - f"{wallet.coldkeypub.ss58_address}" - ) - return False # Check sufficient stake stake_in_origin, stake_in_destination = await _get_stake_in_origin_and_dest( @@ -194,14 +186,6 @@ async def swap_stake_extrinsic( bool: True if the swap was successful, False otherwise. """ amount.set_unit(netuid=origin_netuid) - # Verify ownership - hotkey_owner = await subtensor.get_hotkey_owner(hotkey_ss58) - if hotkey_owner != wallet.coldkeypub.ss58_address: - logging.error( - f":cross_mark: [red]Failed[/red]: Hotkey: {hotkey_ss58} does not belong to the origin coldkey owner: " - f"{wallet.coldkeypub.ss58_address}" - ) - return False # Check sufficient stake stake_in_origin, stake_in_destination = await _get_stake_in_origin_and_dest( diff --git a/bittensor/core/extrinsics/move_stake.py b/bittensor/core/extrinsics/move_stake.py index 3e7e49eefd..d3874f1e68 100644 --- a/bittensor/core/extrinsics/move_stake.py +++ b/bittensor/core/extrinsics/move_stake.py @@ -68,14 +68,6 @@ def transfer_stake_extrinsic( """ amount.set_unit(netuid=origin_netuid) - # Verify ownership - hotkey_owner = subtensor.get_hotkey_owner(hotkey_ss58) - if hotkey_owner != wallet.coldkeypub.ss58_address: - logging.error( - f":cross_mark: [red]Failed[/red]: Hotkey: {hotkey_ss58} does not belong to the origin coldkey owner: " - f"{wallet.coldkeypub.ss58_address}" - ) - return False # Check sufficient stake stake_in_origin, stake_in_destination = _get_stake_in_origin_and_dest( @@ -192,14 +184,6 @@ def swap_stake_extrinsic( """ amount.set_unit(netuid=origin_netuid) - # Verify ownership - hotkey_owner = subtensor.get_hotkey_owner(hotkey_ss58) - if hotkey_owner != wallet.coldkeypub.ss58_address: - logging.error( - f":cross_mark: [red]Failed[/red]: Hotkey: {hotkey_ss58} does not belong to the origin coldkey owner: " - f"{wallet.coldkeypub.ss58_address}" - ) - return False # Check sufficient stake stake_in_origin, stake_in_destination = _get_stake_in_origin_and_dest( diff --git a/tests/unit_tests/test_subtensor_extended.py b/tests/unit_tests/test_subtensor_extended.py index 09fcdb6d97..ec6015174b 100644 --- a/tests/unit_tests/test_subtensor_extended.py +++ b/tests/unit_tests/test_subtensor_extended.py @@ -1484,31 +1484,6 @@ def test_transfer_stake_error( ) -def test_transfer_stake_non_owner(mock_substrate, subtensor, fake_wallet, mocker): - mocker.patch.object( - subtensor, - "get_hotkey_owner", - autospec=True, - return_value="owner2_ss58", - ) - - success = subtensor.transfer_stake( - fake_wallet, - "dest", - "hotkey_ss58", - origin_netuid=1, - destination_netuid=1, - amount=Balance(1), - ) - - assert success is False - - subtensor.get_hotkey_owner.assert_called_once_with( - "hotkey_ss58", - ) - mock_substrate.submit_extrinsic.assert_not_called() - - def test_transfer_stake_insufficient_stake( mock_substrate, subtensor, fake_wallet, mocker ):