Skip to content

Commit 108c625

Browse files
committed
test: remove unused totalOut code
In `wallet_fundrawtransaction`, `totalOut` is used in some functions to check if the change is correct. In other ones, it has been created but never used.
1 parent 0fc3dee commit 108c625

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

test/functional/wallet_fundrawtransaction.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,6 @@ def test_simple_two_outputs(self):
206206

207207
rawtxfund = self.nodes[2].fundrawtransaction(rawtx)
208208
dec_tx = self.nodes[2].decoderawtransaction(rawtxfund['hex'])
209-
totalOut = 0
210-
for out in dec_tx['vout']:
211-
totalOut += out['value']
212209

213210
assert len(dec_tx['vin']) > 0
214211
assert_equal(dec_tx['vin'][0]['scriptSig']['hex'], '')
@@ -331,10 +328,8 @@ def test_coin_selection(self):
331328
rawtxfund = self.nodes[2].fundrawtransaction(rawtx)
332329

333330
dec_tx = self.nodes[2].decoderawtransaction(rawtxfund['hex'])
334-
totalOut = 0
335331
matchingOuts = 0
336332
for i, out in enumerate(dec_tx['vout']):
337-
totalOut += out['value']
338333
if out['scriptPubKey']['address'] in outputs:
339334
matchingOuts+=1
340335
else:
@@ -361,10 +356,8 @@ def test_two_vin(self):
361356
assert_raises_rpc_error(-4, ERR_NOT_ENOUGH_PRESET_INPUTS, self.nodes[2].fundrawtransaction, rawtx, add_inputs=False)
362357
rawtxfund = self.nodes[2].fundrawtransaction(rawtx, add_inputs=True)
363358
dec_tx = self.nodes[2].decoderawtransaction(rawtxfund['hex'])
364-
totalOut = 0
365359
matchingOuts = 0
366360
for out in dec_tx['vout']:
367-
totalOut += out['value']
368361
if out['scriptPubKey']['address'] in outputs:
369362
matchingOuts+=1
370363

@@ -395,10 +388,8 @@ def test_two_vin_two_vout(self):
395388
rawtxfund = self.nodes[2].fundrawtransaction(rawtx, add_inputs=True)
396389

397390
dec_tx = self.nodes[2].decoderawtransaction(rawtxfund['hex'])
398-
totalOut = 0
399391
matchingOuts = 0
400392
for out in dec_tx['vout']:
401-
totalOut += out['value']
402393
if out['scriptPubKey']['address'] in outputs:
403394
matchingOuts+=1
404395

0 commit comments

Comments
 (0)