diff --git a/src/action/wallet.js b/src/action/wallet.js index bbf25b767..3754ba45a 100644 --- a/src/action/wallet.js +++ b/src/action/wallet.js @@ -37,8 +37,8 @@ class WalletAction { * @param {string} options.word The seed word * @param {number} options.index The seed index */ - setSeedVerify({ word, index }) { - this._store.wallet.seedVerify[index] = word; + setSeedVerify({ word = '', index }) { + this._store.wallet.seedVerify[index] = word.toLowerCase(); } // diff --git a/test/unit/action/wallet.spec.js b/test/unit/action/wallet.spec.js index 673606e56..6520ecfdf 100644 --- a/test/unit/action/wallet.spec.js +++ b/test/unit/action/wallet.spec.js @@ -47,10 +47,15 @@ describe('Action Wallet Unit Tests', () => { }); describe('setSeedVerify()', () => { - it('should clear attributes', () => { + it('should set seed word', () => { wallet.setSeedVerify({ word: 'foo', index: 1 }); expect(store.wallet.seedVerify[1], 'to equal', 'foo'); }); + + it('should make seed word lowercase', () => { + wallet.setSeedVerify({ word: 'FOO', index: 1 }); + expect(store.wallet.seedVerify[1], 'to equal', 'foo'); + }); }); describe('initSetPassword()', () => {