Skip to content

Commit eefff65

Browse files
committed
scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests
-BEGIN VERIFY SCRIPT- sed -i 's/\<signrawtransaction\>/signrawtransactionwithwallet/g' test/functional/*.py sed -i 's/\<signrawtransaction\>/signrawtransactionwithwallet/g' test/functional/test_framework/*.py -END VERIFY SCRIPT-
1 parent 1e79c05 commit eefff65

25 files changed

+62
-62
lines changed

test/functional/feature_bip68_sequence.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_disable_flag(self):
7070
tx1.vin = [CTxIn(COutPoint(int(utxo["txid"], 16), utxo["vout"]), nSequence=sequence_value)]
7171
tx1.vout = [CTxOut(value, CScript([b'a']))]
7272

73-
tx1_signed = self.nodes[0].signrawtransaction(ToHex(tx1))["hex"]
73+
tx1_signed = self.nodes[0].signrawtransactionwithwallet(ToHex(tx1))["hex"]
7474
tx1_id = self.nodes[0].sendrawtransaction(tx1_signed)
7575
tx1_id = int(tx1_id, 16)
7676

@@ -176,7 +176,7 @@ def test_sequence_lock_confirmed_inputs(self):
176176
# Overestimate the size of the tx - signatures should be less than 120 bytes, and leave 50 for the output
177177
tx_size = len(ToHex(tx))//2 + 120*num_inputs + 50
178178
tx.vout.append(CTxOut(int(value-self.relayfee*tx_size*COIN/1000), CScript([b'a'])))
179-
rawtx = self.nodes[0].signrawtransaction(ToHex(tx))["hex"]
179+
rawtx = self.nodes[0].signrawtransactionwithwallet(ToHex(tx))["hex"]
180180

181181
if (using_sequence_locks and not should_pass):
182182
# This transaction should be rejected
@@ -205,7 +205,7 @@ def test_sequence_lock_unconfirmed_inputs(self):
205205
tx2.nVersion = 2
206206
tx2.vin = [CTxIn(COutPoint(tx1.sha256, 0), nSequence=0)]
207207
tx2.vout = [CTxOut(int(tx1.vout[0].nValue - self.relayfee*COIN), CScript([b'a']))]
208-
tx2_raw = self.nodes[0].signrawtransaction(ToHex(tx2))["hex"]
208+
tx2_raw = self.nodes[0].signrawtransactionwithwallet(ToHex(tx2))["hex"]
209209
tx2 = FromHex(tx2, tx2_raw)
210210
tx2.rehash()
211211

@@ -278,7 +278,7 @@ def test_nonzero_locks(orig_tx, node, relayfee, use_height_lock):
278278
utxos = self.nodes[0].listunspent()
279279
tx5.vin.append(CTxIn(COutPoint(int(utxos[0]["txid"], 16), utxos[0]["vout"]), nSequence=1))
280280
tx5.vout[0].nValue += int(utxos[0]["amount"]*COIN)
281-
raw_tx5 = self.nodes[0].signrawtransaction(ToHex(tx5))["hex"]
281+
raw_tx5 = self.nodes[0].signrawtransactionwithwallet(ToHex(tx5))["hex"]
282282

283283
assert_raises_rpc_error(-26, NOT_FINAL_ERROR, self.nodes[0].sendrawtransaction, raw_tx5)
284284

@@ -338,7 +338,7 @@ def test_bip68_not_consensus(self):
338338
tx2.vout = [CTxOut(int(tx1.vout[0].nValue - self.relayfee*COIN), CScript([b'a']))]
339339

340340
# sign tx2
341-
tx2_raw = self.nodes[0].signrawtransaction(ToHex(tx2))["hex"]
341+
tx2_raw = self.nodes[0].signrawtransactionwithwallet(ToHex(tx2))["hex"]
342342
tx2 = FromHex(tx2, tx2_raw)
343343
tx2.rehash()
344344

@@ -388,7 +388,7 @@ def test_version2_relay(self):
388388
rawtxfund = self.nodes[1].fundrawtransaction(rawtx)['hex']
389389
tx = FromHex(CTransaction(), rawtxfund)
390390
tx.nVersion = 2
391-
tx_signed = self.nodes[1].signrawtransaction(ToHex(tx))["hex"]
391+
tx_signed = self.nodes[1].signrawtransactionwithwallet(ToHex(tx))["hex"]
392392
self.nodes[1].sendrawtransaction(tx_signed)
393393

394394
if __name__ == '__main__':

test/functional/feature_bip9_softforks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def create_transaction(self, node, coinbase, to_address, amount):
5151
return tx
5252

5353
def sign_transaction(self, node, tx):
54-
signresult = node.signrawtransaction(bytes_to_hex_str(tx.serialize()))
54+
signresult = node.signrawtransactionwithwallet(bytes_to_hex_str(tx.serialize()))
5555
tx = CTransaction()
5656
f = BytesIO(hex_str_to_bytes(signresult['hex']))
5757
tx.deserialize(f)

test/functional/feature_cltv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def cltv_validate(node, tx, height):
4141
tx.nLockTime = height
4242

4343
# Need to re-sign, since nSequence and nLockTime changed
44-
signed_result = node.signrawtransaction(ToHex(tx))
44+
signed_result = node.signrawtransactionwithwallet(ToHex(tx))
4545
new_tx = CTransaction()
4646
new_tx.deserialize(BytesIO(hex_str_to_bytes(signed_result['hex'])))
4747

@@ -54,7 +54,7 @@ def create_transaction(node, coinbase, to_address, amount):
5454
inputs = [{ "txid" : from_txid, "vout" : 0}]
5555
outputs = { to_address : amount }
5656
rawtx = node.createrawtransaction(inputs, outputs)
57-
signresult = node.signrawtransaction(rawtx)
57+
signresult = node.signrawtransactionwithwallet(rawtx)
5858
tx = CTransaction()
5959
tx.deserialize(BytesIO(hex_str_to_bytes(signresult['hex'])))
6060
return tx

test/functional/feature_csv_activation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def create_transaction(self, node, txid, to_address, amount):
118118

119119
def sign_transaction(self, node, unsignedtx):
120120
rawtx = ToHex(unsignedtx)
121-
signresult = node.signrawtransaction(rawtx)
121+
signresult = node.signrawtransactionwithwallet(rawtx)
122122
tx = CTransaction()
123123
f = BytesIO(hex_str_to_bytes(signresult['hex']))
124124
tx.deserialize(f)

test/functional/feature_dbcrash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def generate_small_transactions(self, node, count, utxo_list):
206206
tx.vout.append(CTxOut(output_amount, hex_str_to_bytes(utxo['scriptPubKey'])))
207207

208208
# Sign and send the transaction to get into the mempool
209-
tx_signed_hex = node.signrawtransaction(ToHex(tx))['hex']
209+
tx_signed_hex = node.signrawtransactionwithwallet(ToHex(tx))['hex']
210210
node.sendrawtransaction(tx_signed_hex)
211211
num_transactions += 1
212212

test/functional/feature_dersig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def create_transaction(node, coinbase, to_address, amount):
4242
inputs = [{ "txid" : from_txid, "vout" : 0}]
4343
outputs = { to_address : amount }
4444
rawtx = node.createrawtransaction(inputs, outputs)
45-
signresult = node.signrawtransaction(rawtx)
45+
signresult = node.signrawtransactionwithwallet(rawtx)
4646
tx = CTransaction()
4747
tx.deserialize(BytesIO(hex_str_to_bytes(signresult['hex'])))
4848
return tx

test/functional/feature_fee_estimation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def split_inputs(from_node, txins, txouts, initial_split=False):
9191
# If this is the initial split we actually need to sign the transaction
9292
# Otherwise we just need to insert the proper ScriptSig
9393
if (initial_split):
94-
completetx = from_node.signrawtransaction(ToHex(tx))["hex"]
94+
completetx = from_node.signrawtransactionwithwallet(ToHex(tx))["hex"]
9595
else:
9696
tx.vin[0].scriptSig = SCRIPT_SIG[prevtxout["vout"]]
9797
completetx = ToHex(tx)

test/functional/feature_nulldummy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def create_transaction(self, node, txid, to_address, amount):
102102
inputs = [{ "txid" : txid, "vout" : 0}]
103103
outputs = { to_address : amount }
104104
rawtx = node.createrawtransaction(inputs, outputs)
105-
signresult = node.signrawtransaction(rawtx)
105+
signresult = node.signrawtransactionwithwallet(rawtx)
106106
tx = CTransaction()
107107
f = BytesIO(hex_str_to_bytes(signresult['hex']))
108108
tx.deserialize(f)

test/functional/feature_rbf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def make_utxo(node, amount, confirmed=True, scriptPubKey=CScript([1])):
4242
tx2.vout = [CTxOut(amount, scriptPubKey)]
4343
tx2.rehash()
4444

45-
signed_tx = node.signrawtransaction(txToHex(tx2))
45+
signed_tx = node.signrawtransactionwithwallet(txToHex(tx2))
4646

4747
txid = node.sendrawtransaction(signed_tx['hex'], True)
4848

test/functional/feature_segwit.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def run_test(self):
221221
tx = CTransaction()
222222
tx.vin.append(CTxIn(COutPoint(int(txid1, 16), 0), b''))
223223
tx.vout.append(CTxOut(int(49.99*COIN), CScript([OP_TRUE])))
224-
tx2_hex = self.nodes[0].signrawtransaction(ToHex(tx))['hex']
224+
tx2_hex = self.nodes[0].signrawtransactionwithwallet(ToHex(tx))['hex']
225225
txid2 = self.nodes[0].sendrawtransaction(tx2_hex)
226226
tx = FromHex(CTransaction(), tx2_hex)
227227
assert(not tx.wit.is_null())
@@ -559,7 +559,7 @@ def run_test(self):
559559

560560
self.nodes[1].importaddress(scriptPubKey, "", False)
561561
rawtxfund = self.nodes[1].fundrawtransaction(transaction)['hex']
562-
rawtxfund = self.nodes[1].signrawtransaction(rawtxfund)["hex"]
562+
rawtxfund = self.nodes[1].signrawtransactionwithwallet(rawtxfund)["hex"]
563563
txid = self.nodes[1].sendrawtransaction(rawtxfund)
564564

565565
assert_equal(self.nodes[1].gettransaction(txid, True)["txid"], txid)
@@ -578,7 +578,7 @@ def mine_and_test_listunspent(self, script_list, ismine):
578578
for i in script_list:
579579
tx.vout.append(CTxOut(10000000, i))
580580
tx.rehash()
581-
signresults = self.nodes[0].signrawtransaction(bytes_to_hex_str(tx.serialize_without_witness()))['hex']
581+
signresults = self.nodes[0].signrawtransactionwithwallet(bytes_to_hex_str(tx.serialize_without_witness()))['hex']
582582
txid = self.nodes[0].sendrawtransaction(signresults, True)
583583
self.nodes[0].generate(1)
584584
sync_blocks(self.nodes)
@@ -630,7 +630,7 @@ def create_and_mine_tx_from_txids(self, txids, success = True):
630630
tx.vin.append(CTxIn(COutPoint(int('0x'+i,0), j)))
631631
tx.vout.append(CTxOut(0, CScript()))
632632
tx.rehash()
633-
signresults = self.nodes[0].signrawtransaction(bytes_to_hex_str(tx.serialize_without_witness()))['hex']
633+
signresults = self.nodes[0].signrawtransactionwithwallet(bytes_to_hex_str(tx.serialize_without_witness()))['hex']
634634
self.nodes[0].sendrawtransaction(signresults, True)
635635
self.nodes[0].generate(1)
636636
sync_blocks(self.nodes)

0 commit comments

Comments
 (0)