ECPair/HDNode: missing version from list is Unknown, not Invalid

This commit is contained in:
Daniel Cousens 2016-02-25 13:48:29 +11:00
parent bdb0dd4a17
commit aae5db6a59
4 changed files with 5 additions and 3 deletions

View file

@ -66,6 +66,8 @@ ECPair.fromWIF = function (string, network) {
network = network.filter(function (network) {
return version === network.wif
}).pop()
if (!network) throw new Error('Unknown network version')
}
network = network || NETWORKS.bitcoin

View file

@ -66,7 +66,7 @@ HDNode.fromBase58 = function (string, networks) {
version === network.bip32.public
}).pop()
if (!network) throw new Error('Invalid network version')
if (!network) throw new Error('Unknown network version')
// otherwise, assume a network object (or default to bitcoin)
} else {

View file

@ -111,7 +111,7 @@
"WIF": "92Qba5hnyWSn5Ffcka56yMQauaWY6ZLd91Vzxbi4a9CCetaHtYj"
},
{
"exception": "Invalid network version",
"exception": "Unknown network version",
"WIF": "brQnSed3Fia1w9VcbbS6ZGDgJ6ENkgwuQY2LS7pEC5bKHD1fMF"
},
{

View file

@ -199,7 +199,7 @@
"string": "xprvQQQQQQQQQQQQQQQQCviVfJSKyQ1mDYahRjijr5idH2WwLsEd4Hsb2Tyh8RfQMuPh7f7RtyzTtdrbdqqsunu5Mm3wDvUAKRHSC34sJ7in334"
},
{
"exception": "Invalid network version",
"exception": "Unknown network version",
"string": "1111111111111adADjFaSNPxwXqLjHLj4mBfYxuewDPbw9hEj1uaXCzMxRPXDFF3cUoezTFYom4sEmEVSQmENPPR315cFk9YUFVek73wE9"
},
{