Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 24a627a

Browse files
valentinewallacetanx
authored andcommitted
Trim whitespce on seed verify words.
1 parent bce02fe commit 24a627a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/action/wallet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class WalletAction {
4343
* @param {number} options.index The seed index
4444
*/
4545
setSeedVerify({ word = '', index }) {
46-
this._store.wallet.seedVerify[index] = word.toLowerCase();
46+
this._store.wallet.seedVerify[index] = word.toLowerCase().trim();
4747
}
4848

4949
/**

test/unit/action/wallet.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ describe('Action Wallet Unit Tests', () => {
5858
wallet.setSeedVerify({ word: 'FOO', index: 1 });
5959
expect(store.wallet.seedVerify[1], 'to equal', 'foo');
6060
});
61+
62+
it('should trim whitespace', () => {
63+
wallet.setSeedVerify({ word: ' foo ', index: 1 });
64+
expect(store.wallet.seedVerify[1], 'to equal', 'foo');
65+
});
6166
});
6267

6368
describe('initSetPassword()', () => {

0 commit comments

Comments
 (0)