From de1cb51ef57ed6bfab5a00685d886bf2e0ce3ef3 Mon Sep 17 00:00:00 2001 From: droppingbeans Date: Wed, 4 Feb 2026 06:08:57 +0000 Subject: [PATCH] Fix incomplete wallet creation example in testing docs - Updated wallet creation example with required parameters - Added explanatory comments about use_password and overwrite - Fixed assertion to check actual wallet properties - Updated explanation text for clarity This fixes the documentation bug where create_new_coldkey() was shown without required parameters, which would cause errors for developers following the testing guide. --- contrib/TESTING.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/contrib/TESTING.md b/contrib/TESTING.md index 8e38a7bb17..7d2f6d16a7 100644 --- a/contrib/TESTING.md +++ b/contrib/TESTING.md @@ -34,16 +34,17 @@ import bittensor def test_some_functionality(): # Setup any necessary objects or state. - wallet = bittensor.Wallet() - - # Call the function you're testing. - result = wallet.create_new_coldkey() - - # Assert that the function behaved as expected. - assert result is not None + wallet = bittensor.Wallet(name="test_wallet", hotkey="test_hotkey") + + # Create a new coldkey with required parameters + wallet.create_new_coldkey(use_password=False, overwrite=True) + + # Assert that the wallet was created successfully + assert wallet.coldkey is not None + assert wallet.coldkeypub is not None ``` -In this example, we're testing the `create_new_coldkey` function of the `wallet` object. We assert that the result is not `None`, which is the expected behavior. +In this example, we're testing the wallet creation functionality. We create a wallet with a name and hotkey, then create a new coldkey with the required parameters. The `use_password=False` parameter disables password protection for testing purposes, and `overwrite=True` allows overwriting existing keys. ## Mocking