fix: MultiAccountImportMnemonic: Remove extra spaces in the entered mnemonic (#2476)
This commit is contained in:
parent
5512e19d83
commit
9d3f2d82f1
|
@ -2,6 +2,7 @@ package statusgo
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MultiAccountGenerateParams are the params sent to MultiAccountGenerate.
|
// MultiAccountGenerateParams are the params sent to MultiAccountGenerate.
|
||||||
|
@ -165,7 +166,10 @@ func MultiAccountImportMnemonic(paramsJSON string) string {
|
||||||
return makeJSONResponse(err)
|
return makeJSONResponse(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := statusBackend.AccountManager().AccountsGenerator().ImportMnemonic(p.MnemonicPhrase, p.Bip39Passphrase)
|
// remove any duplicate whitespaces
|
||||||
|
mnemonicPhraseNoExtraSpaces := strings.Join(strings.Fields(p.MnemonicPhrase), " ")
|
||||||
|
|
||||||
|
resp, err := statusBackend.AccountManager().AccountsGenerator().ImportMnemonic(mnemonicPhraseNoExtraSpaces, p.Bip39Passphrase)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return makeJSONResponse(err)
|
return makeJSONResponse(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue