aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorCsaba Solya <csaba.solya@gmail.com>2018-03-03 21:11:02 +0800
committerCsaba Solya <csaba.solya@gmail.com>2018-03-03 21:11:02 +0800
commit3e05b693dbf55ea7ecb791e8f31b7599a6b89ffd (patch)
tree676aba91d6f1d597c9fcabce318e89f788ef4f14 /test/unit
parent4bd7f1a37abcd09dc8816fc5b28ad41bc86b1aea (diff)
downloadtangerine-wallet-browser-3e05b693dbf55ea7ecb791e8f31b7599a6b89ffd.tar
tangerine-wallet-browser-3e05b693dbf55ea7ecb791e8f31b7599a6b89ffd.tar.gz
tangerine-wallet-browser-3e05b693dbf55ea7ecb791e8f31b7599a6b89ffd.tar.bz2
tangerine-wallet-browser-3e05b693dbf55ea7ecb791e8f31b7599a6b89ffd.tar.lz
tangerine-wallet-browser-3e05b693dbf55ea7ecb791e8f31b7599a6b89ffd.tar.xz
tangerine-wallet-browser-3e05b693dbf55ea7ecb791e8f31b7599a6b89ffd.tar.zst
tangerine-wallet-browser-3e05b693dbf55ea7ecb791e8f31b7599a6b89ffd.zip
verify addresses regardless case
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/seed-phrase-verifier-test.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/unit/seed-phrase-verifier-test.js b/test/unit/seed-phrase-verifier-test.js
index a7a463dd3..3e9acfa82 100644
--- a/test/unit/seed-phrase-verifier-test.js
+++ b/test/unit/seed-phrase-verifier-test.js
@@ -33,6 +33,50 @@ describe('SeedPhraseVerifier', function () {
let result = await seedPhraseVerifier.verifyAccounts(createdAccounts, seedWords)
})
+ it('should be able to verify created account (upper case) with seed words', async function () {
+
+ let keyringController = new KeyringController({
+ initState: clone(firstTimeState),
+ encryptor: mockEncryptor,
+ })
+ assert(keyringController)
+
+ let vault = await keyringController.createNewVaultAndKeychain(password)
+ let primaryKeyring = keyringController.getKeyringsByType(hdKeyTree)[0]
+
+ let createdAccounts = await primaryKeyring.getAccounts()
+ assert.equal(createdAccounts.length, 1)
+ let upperCaseAccounts = [createdAccounts[0].toUpperCase()]
+
+ let serialized = await primaryKeyring.serialize()
+ let seedWords = serialized.mnemonic
+ assert.notEqual(seedWords.length, 0)
+
+ let result = await seedPhraseVerifier.verifyAccounts(upperCaseAccounts, seedWords)
+ })
+
+ it('should be able to verify created account (lower case) with seed words', async function () {
+
+ let keyringController = new KeyringController({
+ initState: clone(firstTimeState),
+ encryptor: mockEncryptor,
+ })
+ assert(keyringController)
+
+ let vault = await keyringController.createNewVaultAndKeychain(password)
+ let primaryKeyring = keyringController.getKeyringsByType(hdKeyTree)[0]
+
+ let createdAccounts = await primaryKeyring.getAccounts()
+ assert.equal(createdAccounts.length, 1)
+ let lowerCaseAccounts = [createdAccounts[0].toLowerCase()]
+
+ let serialized = await primaryKeyring.serialize()
+ let seedWords = serialized.mnemonic
+ assert.notEqual(seedWords.length, 0)
+
+ let result = await seedPhraseVerifier.verifyAccounts(lowerCaseAccounts, seedWords)
+ })
+
it('should return error with good but different seed words', async function () {
let keyringController = new KeyringController({