Commit 14226ab2 authored by Valentine Wallace's avatar Valentine Wallace

Trim seed word whitespace to avoid obscure errors.

parent 89b74488
......@@ -53,7 +53,7 @@ class WalletAction {
* @param {number} options.index The seed index
*/
setRestoreSeed({ word, index }) {
this._store.seedMnemonic[index] = word;
this._store.seedMnemonic[index] = word.trim();
}
/**
......
......@@ -382,6 +382,11 @@ describe('Action Wallet Unit Tests', () => {
wallet.setRestoreSeed({ word: 'foo', index: 1 });
expect(store.seedMnemonic[1], 'to equal', 'foo');
});
it('should trim whitespace', () => {
wallet.setRestoreSeed({ word: ' foo ', index: 1 });
expect(store.seedMnemonic[1], 'to equal', 'foo');
});
});
describe('setFocusedRestoreInd()', () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment