HDNode/tests: add testing for invalid network version from networks list
This commit is contained in:
parent
9e32c892ef
commit
bdb0dd4a17
3 changed files with 9 additions and 6 deletions
test
5
test/fixtures/hdnode.json
vendored
5
test/fixtures/hdnode.json
vendored
|
@ -199,11 +199,12 @@
|
|||
"string": "xprvQQQQQQQQQQQQQQQQCviVfJSKyQ1mDYahRjijr5idH2WwLsEd4Hsb2Tyh8RfQMuPh7f7RtyzTtdrbdqqsunu5Mm3wDvUAKRHSC34sJ7in334"
|
||||
},
|
||||
{
|
||||
"exception": "Invalid network",
|
||||
"exception": "Invalid network version",
|
||||
"string": "1111111111111adADjFaSNPxwXqLjHLj4mBfYxuewDPbw9hEj1uaXCzMxRPXDFF3cUoezTFYom4sEmEVSQmENPPR315cFk9YUFVek73wE9"
|
||||
},
|
||||
{
|
||||
"exception": "Invalid network",
|
||||
"exception": "Invalid network version",
|
||||
"network": "bitcoin",
|
||||
"string": "Ltpv73XYpw28ZyVe2zEVyiFnxUZxoKLGQNdZ8NxUi1WcqjNmMBgtLbh3KimGSnPHCoLv1RmvxHs4dnKmo1oXQ8dXuDu8uroxrbVxZPA1gXboYvx"
|
||||
}
|
||||
],
|
||||
|
|
|
@ -210,9 +210,9 @@ describe('HDNode', function () {
|
|||
fixtures.invalid.fromBase58.forEach(function (f) {
|
||||
it('throws on ' + f.string, function () {
|
||||
assert.throws(function () {
|
||||
var network = NETWORKS[f.network]
|
||||
var networks = f.network ? NETWORKS[f.network] : NETWORKS_LIST
|
||||
|
||||
HDNode.fromBase58(f.string, network)
|
||||
HDNode.fromBase58(f.string, networks)
|
||||
}, new RegExp(f.exception))
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue