|
|
@ -108,7 +108,7 @@ class ImportMultiTest (BitcoinTestFramework): |
|
|
|
"scriptPubKey": address['scriptPubKey'], |
|
|
|
"scriptPubKey": address['scriptPubKey'], |
|
|
|
"pubkeys": [ address['pubkey'] ], |
|
|
|
"pubkeys": [ address['pubkey'] ], |
|
|
|
"internal": True |
|
|
|
"internal": True |
|
|
|
}]; |
|
|
|
}] |
|
|
|
result = self.nodes[1].importmulti(request) |
|
|
|
result = self.nodes[1].importmulti(request) |
|
|
|
assert_equal(result[0]['success'], True) |
|
|
|
assert_equal(result[0]['success'], True) |
|
|
|
address_assert = self.nodes[1].validateaddress(address['address']) |
|
|
|
address_assert = self.nodes[1].validateaddress(address['address']) |
|
|
@ -121,7 +121,7 @@ class ImportMultiTest (BitcoinTestFramework): |
|
|
|
request = [{ |
|
|
|
request = [{ |
|
|
|
"scriptPubKey": address['scriptPubKey'], |
|
|
|
"scriptPubKey": address['scriptPubKey'], |
|
|
|
"pubkeys": [ address['pubkey'] ] |
|
|
|
"pubkeys": [ address['pubkey'] ] |
|
|
|
}]; |
|
|
|
}] |
|
|
|
result = self.nodes[1].importmulti(request) |
|
|
|
result = self.nodes[1].importmulti(request) |
|
|
|
assert_equal(result[0]['success'], False) |
|
|
|
assert_equal(result[0]['success'], False) |
|
|
|
assert_equal(result[0]['error']['code'], -8) |
|
|
|
assert_equal(result[0]['error']['code'], -8) |
|
|
@ -197,7 +197,7 @@ class ImportMultiTest (BitcoinTestFramework): |
|
|
|
self.nodes[1].generate(100) |
|
|
|
self.nodes[1].generate(100) |
|
|
|
transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00) |
|
|
|
transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00) |
|
|
|
self.nodes[1].generate(1) |
|
|
|
self.nodes[1].generate(1) |
|
|
|
transaction = self.nodes[1].gettransaction(transactionid); |
|
|
|
transaction = self.nodes[1].gettransaction(transactionid) |
|
|
|
|
|
|
|
|
|
|
|
print("Should import a p2sh") |
|
|
|
print("Should import a p2sh") |
|
|
|
result = self.nodes[1].importmulti([{ |
|
|
|
result = self.nodes[1].importmulti([{ |
|
|
@ -222,7 +222,7 @@ class ImportMultiTest (BitcoinTestFramework): |
|
|
|
self.nodes[1].generate(100) |
|
|
|
self.nodes[1].generate(100) |
|
|
|
transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00) |
|
|
|
transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00) |
|
|
|
self.nodes[1].generate(1) |
|
|
|
self.nodes[1].generate(1) |
|
|
|
transaction = self.nodes[1].gettransaction(transactionid); |
|
|
|
transaction = self.nodes[1].gettransaction(transactionid) |
|
|
|
|
|
|
|
|
|
|
|
print("Should import a p2sh with respective redeem script") |
|
|
|
print("Should import a p2sh with respective redeem script") |
|
|
|
result = self.nodes[1].importmulti([{ |
|
|
|
result = self.nodes[1].importmulti([{ |
|
|
@ -246,7 +246,7 @@ class ImportMultiTest (BitcoinTestFramework): |
|
|
|
self.nodes[1].generate(100) |
|
|
|
self.nodes[1].generate(100) |
|
|
|
transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00) |
|
|
|
transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00) |
|
|
|
self.nodes[1].generate(1) |
|
|
|
self.nodes[1].generate(1) |
|
|
|
transaction = self.nodes[1].gettransaction(transactionid); |
|
|
|
transaction = self.nodes[1].gettransaction(transactionid) |
|
|
|
|
|
|
|
|
|
|
|
print("Should import a p2sh with respective redeem script and private keys") |
|
|
|
print("Should import a p2sh with respective redeem script and private keys") |
|
|
|
result = self.nodes[1].importmulti([{ |
|
|
|
result = self.nodes[1].importmulti([{ |
|
|
@ -270,7 +270,7 @@ class ImportMultiTest (BitcoinTestFramework): |
|
|
|
self.nodes[1].generate(100) |
|
|
|
self.nodes[1].generate(100) |
|
|
|
transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00) |
|
|
|
transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00) |
|
|
|
self.nodes[1].generate(1) |
|
|
|
self.nodes[1].generate(1) |
|
|
|
transaction = self.nodes[1].gettransaction(transactionid); |
|
|
|
transaction = self.nodes[1].gettransaction(transactionid) |
|
|
|
|
|
|
|
|
|
|
|
print("Should import a p2sh with respective redeem script and private keys") |
|
|
|
print("Should import a p2sh with respective redeem script and private keys") |
|
|
|
result = self.nodes[1].importmulti([{ |
|
|
|
result = self.nodes[1].importmulti([{ |
|
|
@ -312,7 +312,7 @@ class ImportMultiTest (BitcoinTestFramework): |
|
|
|
"scriptPubKey": address['scriptPubKey'], |
|
|
|
"scriptPubKey": address['scriptPubKey'], |
|
|
|
"pubkeys": [ address2['pubkey'] ], |
|
|
|
"pubkeys": [ address2['pubkey'] ], |
|
|
|
"internal": True |
|
|
|
"internal": True |
|
|
|
}]; |
|
|
|
}] |
|
|
|
result = self.nodes[1].importmulti(request) |
|
|
|
result = self.nodes[1].importmulti(request) |
|
|
|
assert_equal(result[0]['success'], False) |
|
|
|
assert_equal(result[0]['success'], False) |
|
|
|
assert_equal(result[0]['error']['code'], -5) |
|
|
|
assert_equal(result[0]['error']['code'], -5) |
|
|
|