Renaming Path to Bip32Path, invalid to fixtures

Only thing I haven't been able to do is to add "undefined" to fixtures. So I could not properly test
that node.derivePath() properly fails as it should. However, I added "null" there, and "null" and "undefined"
behave in similar way in JavaScript, so that should catch that.
This commit is contained in:
Karel Bilek 2016-02-14 16:12:16 +01:00
parent d2b43f1dfe
commit 6a74eb6993
4 changed files with 41 additions and 63 deletions

View file

@ -26,7 +26,7 @@ function UInt53 (value) {
Math.floor(value) === value
}
function Path (value) {
function Bip32Path (value) {
return typeforce.String(value) &&
value.match(/^([m]\/)?([0-9]+[']?\/)*([0-9]+[']?)$/)
}
@ -63,7 +63,7 @@ var types = {
UInt31: UInt31,
UInt32: UInt32,
UInt53: UInt53,
Path: Path
Bip32Path: Bip32Path
}
for (var typeName in typeforce) {