A password is mandatory in both .fromV1() and .fromV3()

This commit is contained in:
Alex Beregszaszi 2016-03-16 13:59:58 +00:00
parent 9e9fd6cd6f
commit 9a6acebd2c
1 changed files with 2 additions and 0 deletions

View File

@ -143,6 +143,7 @@ Wallet.fromPrivateKey = function (priv) {
// https://github.com/ethereum/go-ethereum/wiki/Passphrase-protected-key-store-spec
Wallet.fromV1 = function (input, password) {
assert(typeof password === 'string')
var json = (typeof input === 'object') ? input : JSON.parse(input)
if (json.Version !== '1') {
@ -173,6 +174,7 @@ Wallet.fromV1 = function (input, password) {
}
Wallet.fromV3 = function (input, password, nonStrict) {
assert(typeof password === 'string')
var json = (typeof input === 'object') ? input : JSON.parse(nonStrict ? input.toLowerCase() : input)
if (json.version !== 3) {