testing/p2wsh: add missing test case coverage

This commit is contained in:
Daniel Cousens 2018-07-17 15:22:03 +10:00
parent 275b872c7e
commit 14d9636b6e
4 changed files with 51 additions and 6 deletions
src/payments

View file

@ -119,9 +119,9 @@ function p2wsh (a, opts) {
if (opts.validate) {
let hash
if (a.address) {
if (_address().prefix !== network.bech32) throw new TypeError('Network mismatch')
if (_address().version !== 0x00) throw new TypeError('Invalid version')
if (_address().data.length !== 32) throw new TypeError('Invalid data')
if (_address().prefix !== network.bech32) throw new TypeError('Invalid prefix or Network mismatch')
if (_address().version !== 0x00) throw new TypeError('Invalid address version')
if (_address().data.length !== 32) throw new TypeError('Invalid address data')
else hash = _address().data
}