HDNode: clearer error for bad path type

This commit is contained in:
Daniel Cousens 2016-10-10 13:34:40 +11:00 committed by Daniel Cousens
parent 9f1ebf72a6
commit 5dcf38c0c5
2 changed files with 2 additions and 1 deletions

View file

@ -8,6 +8,7 @@ function UInt31 (value) {
function BIP32Path (value) {
return typeforce.String(value) && value.match(/^(m\/)?(\d+'?\/)*\d+'?$/)
}
BIP32Path.toJSON = function () { return 'BIP32 derivation path' }
var SATOSHI_MAX = 2.1 * 1e15
function Satoshi (value) {

View file

@ -384,7 +384,7 @@ describe('HDNode', function () {
fixtures.invalid.derivePath.forEach(function (fx) {
assert.throws(function () {
master.derivePath(fx)
}, /Expected Bip32Path/)
}, /Expected BIP32 derivation path/)
})
})
})