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

fix: seed word parsing #3607

Merged
merged 2 commits into from
Nov 23, 2021

Conversation

StriderDM
Copy link
Contributor

Description

Moved detect_language into MnemonicLanguage and made it public.
Prevented a TariSeedWords object from becoming invalid in the event an invalid or inconsistent word was attempted to be pushed to it in wallet_ffi.
Differentiated between an invalid word and an inconsistent word.
Added word to the string of WordNotFound error.

Motivation and Context

General fixes

How Has This Been Tested?

cargo test --all

} else {
log::error!(
target: LOG_TARGET,
"Word in seed phrase is inconsistent: {:?}",
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean that there is no language matching the words so far? If so I think this error is not very clear. If you saw it in the logs in isolation would you be able to determine what the problem is? Maybe something like "Current words in seed phrase do not match a supported language"

Copy link
Contributor Author

@StriderDM StriderDM Nov 23, 2021

Choose a reason for hiding this comment

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

What is meant here is that by adding the word, the language cannot be determined anymore since there are no words that are either in one language or words common to at least one of them. The error will be UnknownLanguage.

Perhaps a pre-detection of the language prior to this and adding "...previously words were detected to be in language" will help?

base_layer/wallet_ffi/src/lib.rs Outdated Show resolved Hide resolved
Moved detect_language into MnemonicLanguage and made it public.
Prevented a TariSeedWords object from becoming invalid in the event an invalid or inconsistent word was attempted to be pushed to it in wallet_ffi.
Differentiated between an invalid word and an inconsistent word.
Added word to string of WordNotFound error.

Review comments
Copy link
Contributor

@philipr-za philipr-za left a comment

Choose a reason for hiding this comment

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

Good catch

@aviator-app aviator-app bot merged commit fff45db into tari-project:development Nov 23, 2021
sdbondi added a commit to sdbondi/tari that referenced this pull request Nov 23, 2021
* development:
  fix: seed word parsing (tari-project#3607)
  feat: add ban peers metric (tari-project#3605)
  feat!: expose reason for transaction cancellation for callback in wallet_ffi (tari-project#3601)
  test: improve cucumber scenario robustness (tari-project#3599)
  feat: use CipherSeed wallet birthday for recovery start point (tari-project#3602)
  docs: ignore RFC code blocks (tari-project#3603)
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