|
|
@ -102,7 +102,9 @@ describe('Address', function() { |
|
|
|
var key = new bitcore.Key(); |
|
|
|
key.private = privkey; |
|
|
|
key.regenerateSync(); |
|
|
|
var f = function() {new bitcore.Address(0, key.public);}; |
|
|
|
var f = function() { |
|
|
|
new bitcore.Address(0, key.public); |
|
|
|
}; |
|
|
|
expect(f).to.throw(Error); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -149,7 +151,9 @@ describe('Address', function() { |
|
|
|
var pubkey3 = new Buffer('032c0d2e394541e2efdc7ac3500e16e7e69df541f38670402e95aa477202fa06bb', 'hex'); |
|
|
|
var sortedPubKeys = [pubkey3, pubkey2, pubkey1]; |
|
|
|
var mReq = 2; |
|
|
|
var script = bitcore.Script.createMultisig(mReq, sortedPubKeys, {noSorting: true}); |
|
|
|
var script = bitcore.Script.createMultisig(mReq, sortedPubKeys, { |
|
|
|
noSorting: true |
|
|
|
}); |
|
|
|
var hash = bitcore.util.sha256ripe160(script.getBuffer()); |
|
|
|
var version = bitcore.networks['livenet'].P2SHVersion; |
|
|
|
var addr = new Address(version, hash); |
|
|
@ -236,8 +240,7 @@ describe('Address', function() { |
|
|
|
(new Address.fromScriptPubKey(c[0], 'testnet')).toString().should.equal(c[1]); |
|
|
|
var s = new bitcore.Script(new Buffer(c[0], 'hex')); |
|
|
|
(new Address.fromScriptPubKey(s, 'testnet')).toString().should.equal(c[1]); |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
var as = new Address.fromScriptPubKey(c[0], 'testnet'); |
|
|
|
for (var j in as) { |
|
|
|
as[j].toString().should.equal(c[1][j]); |
|
|
|