Skip to content

Adds E2E test for wallet regenerations + fixes input bug for regen hotkey#2149

Merged
ibraheem-abe merged 4 commits intostagingfrom
tests/abe/wallet-regeneration
Jul 24, 2024
Merged

Adds E2E test for wallet regenerations + fixes input bug for regen hotkey#2149
ibraheem-abe merged 4 commits intostagingfrom
tests/abe/wallet-regeneration

Conversation

@ibraheem-abe
Copy link
Contributor

@ibraheem-abe ibraheem-abe commented Jul 19, 2024

We are E2E testing these commands

  • btcli w regen_coldkey
  • btcli w regen_coldkeypub
  • btcli w regen_hotkey

To test regeneration, we compare the modification timestamps of the file before and after regenerating.

This PR also fixes a bug when inputting the mnemonics as a string using the btcli when regenerating hotkeys. Similar bug for coldkeys was fixed in link

@ibraheem-abe ibraheem-abe requested a review from a team July 19, 2024 00:49
@ibraheem-abe ibraheem-abe changed the title Adds test for wallet regenerations + fixes input bug for regen hotkey Adds E2E test for wallet regenerations + fixes input bug for regen hotkey Jul 19, 2024
@ibraheem-abe ibraheem-abe requested review from a team and removed request for a team July 22, 2024 16:52
Copy link
Collaborator

@basfroman basfroman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just left a few style related comments

if isinstance(mnemonic, str):
mnemonic = mnemonic.split()
elif isinstance(mnemonic, list) and len(mnemonic) == 1:
mnemonic = mnemonic[0].split()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future review of the code, it would be useful to have a comment describing what mnemonic[0] is and why we are using this particular index.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey!
So if we pass the mnemonics encapsulated as a string like:
btcli w regen_coldkey "word word word word......"

The cli doesn't register it at the moment- it actually gets parsed as a list of 1 element which is what we are checking here and then extracting it

@ibraheem-abe ibraheem-abe merged commit dae9532 into staging Jul 24, 2024
@ibraheem-abe ibraheem-abe mentioned this pull request Aug 23, 2024
@thewhaleking thewhaleking deleted the tests/abe/wallet-regeneration branch December 3, 2024 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants