@@ -14,35 +14,34 @@ var Signature = bitcore.crypto.Signature;
1414var MultiSigInput = bitcore . Transaction . Input . MultiSig ;
1515
1616describe ( 'MultiSigInput' , function ( ) {
17-
18- var privateKey1 = new PrivateKey ( 'T35QnUj2z2sAg5NHg8n73RaXvrgRQb6Ubk7jeHwYatXDHFvTPJyA' ) ;
19- var privateKey2 = new PrivateKey ( 'TAE7EKgdc8XHwfuv63iWt6VnKxdjgL587oXXhDmTfYp3n339ANkU' ) ;
20- var privateKey3 = new PrivateKey ( 'TA2ixrTAf2jULJcrLtrFcXWpcd2RjR4JsDamBGYCPsYHDrUoVdrp' ) ;
17+ var privateKey1 = new PrivateKey ( '4d03b7d1f48393ab7bdd233cb595c522396f1234a32ca96ac8e2cc560470196b' ) ;
18+ var privateKey2 = new PrivateKey ( 'e99d840de3a46c50b2f85afa5bcb3277fa2c9f32697eeefe1cf5ecf2a6cbd3a7' ) ;
19+ var privateKey3 = new PrivateKey ( '8d85bb60979e350e4fe2f59787c73431637a2dbda0d62f8fb9c0bd816e399157' ) ;
2120 var public1 = privateKey1 . publicKey ;
2221 var public2 = privateKey2 . publicKey ;
2322 var public3 = privateKey3 . publicKey ;
24- var address = new Address ( 'MACk3uzQWfUoPw9FVGsSZLDVeXcCKarBfA ' ) ;
23+ var address = new Address ( 'ADR2xGCbcDu7Akak7udRGR4ugbZF78Fogy ' ) ;
2524
2625 var output = {
2726 txId : '66e64ef8a3b384164b78453fa8c8194de9a473ba14f89485a0e433699daec140' ,
2827 outputIndex : 0 ,
29- script : new Script ( "5221025c95ec627038e85b5688a9b3d84d28c5ebe66e8c8d697d498e20fe96e3b1ab1d2102cdddfc974d41a62f1f80081deee70592feb7d6e6cf6739d6592edbe7946720e72103c95924e02c240b5545089c69c6432447412b58be43fd671918bd184a5009834353ae " ) ,
28+ script : new Script ( "5221022f4e6d26550bdedb5a88de58e2a4d63e36e9e3ffdfa244b5491009e70f47901e2103305b98db06454adefa8e9eff42b4cbc7ce302b5255b0e01774800594eddadb7b2103f88a27019d8e80619076ada9bda728301337008d89563589660e1dc9c23b438153ae " ) ,
3029 satoshis : 1000000
3130 } ;
3231 it ( 'can count missing signatures' , function ( ) {
3332 var transaction = new Transaction ( )
3433 . from ( output , [ public1 , public2 , public3 ] , 2 )
3534 . to ( address , 1000000 ) ;
36- var input = transaction . inputs [ 0 ] ;
35+ var input = transaction . inputs [ 0 ] ;
3736
38- input . countSignatures ( ) . should . equal ( 0 ) ;
37+ input . countSignatures ( ) . should . equal ( 0 ) ;
3938
40- transaction . sign ( privateKey1 ) ;
41- input . countSignatures ( ) . should . equal ( 1 ) ;
42- input . countMissingSignatures ( ) . should . equal ( 1 ) ;
43- input . isFullySigned ( ) . should . equal ( false ) ;
39+ transaction . sign ( privateKey1 ) ;
40+ input . countSignatures ( ) . should . equal ( 1 ) ;
41+ input . countMissingSignatures ( ) . should . equal ( 1 ) ;
42+ input . isFullySigned ( ) . should . equal ( false ) ;
4443
45- transaction . sign ( privateKey2 ) ;
44+ transaction . sign ( privateKey2 ) ;
4645 input . countSignatures ( ) . should . equal ( 2 ) ;
4746 input . countMissingSignatures ( ) . should . equal ( 0 ) ;
4847 input . isFullySigned ( ) . should . equal ( true ) ;
@@ -129,7 +128,7 @@ describe('MultiSigInput', function() {
129128 roundtrip . toObject ( ) . should . deep . equal ( input . toObject ( ) ) ;
130129 } ) ;
131130 it ( 'can parse list of signature buffers, from TX signed with key 1 and 2' , function ( ) {
132- var transaction = new Transaction ( "010000000140c1ae9d6933e4a08594f814ba73a4e94d19c8a83f45784b1684b3a3f84ee666000000009200473044022012bd2f15e56ab1b63d5ee23e194ed995ad4b81a21bcb8e0d913e5e791c07f7280220278bdb6b54cdc608193c869affe28dc2f700902218122770faff25c56142102b01483045022100e74e9955e042aca36f4f3ad907a0926c5b85e5d9608b0678a78a9cbc0259c7a2022053ff761e5f9a80558db7023e45c4979ac3c19a423f0184fb0596d3da308cc4b501ffffffff0140420f000000000017a91419438da7d16709643be5abd8df62ca4034a489a78700000000 " ) ;
131+ var transaction = new Transaction ( "010000000140c1ae9d6933e4a08594f814ba73a4e94d19c8a83f45784b1684b3a3f84ee666000000009200473044022001d776dcb0d45129e2a0260f9a0bbda9c2b17f302e8b286a5c5555a1b1c7a071022009f7418111ee494718f575a2bac3b0f5a1714d6deb87701fe13f8ea672e2004c014830450221008d996e079164e4f9ffadd553b718620d0c34c7852db0a124f0a269a47a16e4fb02207b0324c658db5aec1f9ce2209d033c93cbd5fcde7ede564972d58a90e11b50fb01ffffffff0140420f000000000017a914e61ec81f81d1fef89ea3bc8ee38224fa079b759e8700000000 " ) ;
133132
134133 var inputObj = transaction . inputs [ 0 ] . toObject ( ) ;
135134 inputObj . output = output ;
@@ -152,7 +151,7 @@ describe('MultiSigInput', function() {
152151 transaction . inputs [ 0 ] . isValidSignature ( transaction , transaction . inputs [ 0 ] . signatures [ 1 ] ) . should . be . true ;
153152 } ) ;
154153 it ( 'can parse list of signature buffers, from TX signed with key 3 and 1' , function ( ) {
155- var transaction = new Transaction ( "010000000140c1ae9d6933e4a08594f814ba73a4e94d19c8a83f45784b1684b3a3f84ee666000000009300483045022100fc39ce4f51b2766ec8e978296e0594ea4578a3eb2543722fd4053e92bf16e6b1022030f739868397a881b019508b9c725a5c69a3652cb8928027748e93e67dfaef5501483045022100e74e9955e042aca36f4f3ad907a0926c5b85e5d9608b0678a78a9cbc0259c7a2022053ff761e5f9a80558db7023e45c4979ac3c19a423f0184fb0596d3da308cc4b501ffffffff0140420f000000000017a91419438da7d16709643be5abd8df62ca4034a489a78700000000 " ) ;
154+ var transaction = new Transaction ( "010000000140c1ae9d6933e4a08594f814ba73a4e94d19c8a83f45784b1684b3a3f84ee666000000009300483045022100b02f9f495127c4ccdd5b5aa20a5535250758424b769066666fb0f424570986090220717185e1486c2c194f39e65a5886a7e986e942c6cea4ece80ddbe723c47bc03f014830450221008d996e079164e4f9ffadd553b718620d0c34c7852db0a124f0a269a47a16e4fb02207b0324c658db5aec1f9ce2209d033c93cbd5fcde7ede564972d58a90e11b50fb01ffffffff0140420f000000000017a914e61ec81f81d1fef89ea3bc8ee38224fa079b759e8700000000 " ) ;
156155
157156 var inputObj = transaction . inputs [ 0 ] . toObject ( ) ;
158157 inputObj . output = output ;
0 commit comments