Skip to content

Commit

Permalink
test: Refactor vout fetches in rpc_rawtransaction
Browse files Browse the repository at this point in the history
  • Loading branch information
kallewoof committed Mar 6, 2019
1 parent 4952a95 commit e5efacb
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions test/functional/rpc_rawtransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,7 @@ def run_test(self):

txDetails = self.nodes[0].gettransaction(txId, True)
rawTx = self.nodes[0].decoderawtransaction(txDetails['hex'])
vout = False
for outpoint in rawTx['vout']:
if outpoint['value'] == Decimal('2.20000000'):
vout = outpoint
break
vout = next(o for o in rawTx['vout'] if o['value'] == Decimal('2.20000000'))

bal = self.nodes[0].getbalance()
inputs = [{ "txid" : txId, "vout" : vout['n'], "scriptPubKey" : vout['scriptPubKey']['hex'], "amount" : vout['value']}]
Expand Down Expand Up @@ -330,11 +326,7 @@ def run_test(self):

txDetails = self.nodes[0].gettransaction(txId, True)
rawTx2 = self.nodes[0].decoderawtransaction(txDetails['hex'])
vout = False
for outpoint in rawTx2['vout']:
if outpoint['value'] == Decimal('2.20000000'):
vout = outpoint
break
vout = next(o for o in rawTx2['vout'] if o['value'] == Decimal('2.20000000'))

bal = self.nodes[0].getbalance()
inputs = [{ "txid" : txId, "vout" : vout['n'], "scriptPubKey" : vout['scriptPubKey']['hex'], "redeemScript" : mSigObjValid['hex'], "amount" : vout['value']}]
Expand Down

0 comments on commit e5efacb

Please sign in to comment.