Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not throw on wrong password input #2237

Open
wants to merge 1 commit into
base: rao
Choose a base branch
from

Conversation

gztensor
Copy link
Contributor

When user inputs a wrong password to unlock the wallet, bittensor throws and all user input is lost. This PR fixes this issue.

@camfairchild
Copy link
Collaborator

Black check isn't passing on CI

@thewhaleking
Copy link
Contributor

Black check isn't passing on CI

This should go away. @roman-opentensor can you update the tests for this branch to use ruff instead of black?

except (InvalidSignature, InvalidKey, InvalidToken):
raise bittensor.KeyFileError("Invalid password")
except (InvalidSignature, InvalidKey, InvalidToken, AnsibleVaultError):
print("Wrong password, try again");
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this semicolon

password = None

except Exception as e:
if "Decryption failed. Ciphertext failed verification" in str(e):
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this semicolon

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.

3 participants