bittensor.mock.wallet_mock#

Classes#

MockWallet

Mocked Version of the bittensor wallet class, meant to be used for testing

Functions#

get_mock_wallet([coldkey, hotkey])

get_mock_keypair(uid[, test_name])

Returns a mock keypair from a uid and optional test_name.

get_mock_hotkey(uid)

get_mock_coldkey(uid)

Module Contents#

class bittensor.mock.wallet_mock.MockWallet(**kwargs)[source]#

Bases: bittensor.wallet

Mocked Version of the bittensor wallet class, meant to be used for testing

Init bittensor wallet object containing a hot and coldkey. :param _mock: If true creates a mock wallet with random keys. :type _mock: required=True, default=False

_is_mock = True#
_mocked_coldkey_keyfile = None#
_mocked_hotkey_keyfile = None#
property hotkey_file: bittensor.keyfile#

Property that returns the hotkey file.

Returns:

The hotkey file.

Return type:

bittensor.keyfile

property coldkey_file: bittensor.keyfile#

Property that returns the coldkey file.

Returns:

The coldkey file.

Return type:

bittensor.keyfile

property coldkeypub_file: bittensor.keyfile#

Property that returns the coldkeypub file.

Returns:

The coldkeypub file.

Return type:

bittensor.keyfile

bittensor.mock.wallet_mock.get_mock_wallet(coldkey=None, hotkey=None)[source]#
Parameters:
  • coldkey (bittensor.Keypair)

  • hotkey (bittensor.Keypair)

bittensor.mock.wallet_mock.get_mock_keypair(uid, test_name=None)[source]#

Returns a mock keypair from a uid and optional test_name. If test_name is not provided, the uid is the only seed. If test_name is provided, the uid is hashed with the test_name to create a unique seed for the test.

Parameters:
  • uid (int)

  • test_name (Optional[str])

Return type:

bittensor.Keypair

bittensor.mock.wallet_mock.get_mock_hotkey(uid)[source]#
Parameters:

uid (int)

Return type:

str

bittensor.mock.wallet_mock.get_mock_coldkey(uid)[source]#
Parameters:

uid (int)

Return type:

str