Browse Source

HDNode: clearer error for bad path type

hk-custom-address
Daniel Cousens 8 years ago
committed by Daniel Cousens
parent
commit
5dcf38c0c5
  1. 1
      src/types.js
  2. 2
      test/hdnode.js

1
src/types.js

@ -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) {

2
test/hdnode.js

@ -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/)
})
})
})

Loading…
Cancel
Save