diff --git a/test/test.misc.js b/test/test.misc.js index 22bfc40fc..e58bfccd2 100644 --- a/test/test.misc.js +++ b/test/test.misc.js @@ -108,6 +108,7 @@ describe('Miscelaneous stuff', function() { } else { describe('base58 address valid ' + b58, function() { var a; + var shouldBeScript = meta.addrType === 'script'; before(function() { a = new Address(b58); }); @@ -115,11 +116,16 @@ describe('Miscelaneous stuff', function() { a.isValid().should.equal(true); }); it('should be of correct type', function() { - a.isScript().should.equal(meta.addrType === 'script'); + a.isScript().should.equal(shouldBeScript); }); it('should get correct network', function() { a.network().should.equal(network); }); + it('should generate correctly from hex', function() { + var version = shouldBeScript? network.addressScript: network.addressPubkey; + var b = new Address(version, new Buffer(hexPayload, 'hex')); + b.toString().should.equal(b58); + }); }); } });