jwallet-web-keystore
Advanced tools
Comparing version
{ | ||
"name": "jwallet-web-keystore", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Library for ethereum blockchain accounts management", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -11,2 +11,4 @@ const uuidv4 = require('uuid/v4') | ||
const packageData = require('../package.json') | ||
const ADDRESS_LENGTH = 40 | ||
@@ -30,3 +32,3 @@ const PRIVATE_KEY_LENGTH = 64 | ||
this.salt = utils.generateSalt(this.saltByteCount) | ||
this.version = 1 | ||
this.version = packageData.version | ||
} | ||
@@ -482,3 +484,3 @@ | ||
_restoreBackupData(backupData) { | ||
if (backupData.version === 1) { | ||
if (backupData.version <= packageData.version) { | ||
const { | ||
@@ -501,3 +503,3 @@ accounts, | ||
this.salt = salt || this.salt | ||
this.version = 1 | ||
this.version = packageData.version | ||
} | ||
@@ -554,3 +556,3 @@ } | ||
if (testPasswordResult.failedTests.length) { | ||
throw (new Error('Password is too weak')) | ||
throw (new Error(testPasswordResult.errors[0])) | ||
} | ||
@@ -557,0 +559,0 @@ |
@@ -36,3 +36,3 @@ const should = require('should') | ||
e.should.be.an.Object() | ||
e.message.should.be.equal('Password is too weak') | ||
e.message.should.be.equal('The password must contain at least one uppercase letter') | ||
@@ -193,3 +193,3 @@ done() | ||
it('removeAccounts() should remove all accounts', function(done) { | ||
keystore.removeAccounts() | ||
keystore.removeAccounts(newPassword) | ||
@@ -196,0 +196,0 @@ const accounts = keystore.getAccounts() |
const should = require('should') | ||
const packageData = require('../package.json') | ||
const Keystore = require('../index') | ||
@@ -9,3 +12,3 @@ const keystore = new Keystore() | ||
const accountIdLength = 36 | ||
const currentKeystoreVersion = 1 | ||
const currentKeystoreVersion = packageData.version | ||
@@ -12,0 +15,0 @@ let accountId |
70329
0.31%1414
0.14%