Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/blocktools.py
Show First 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | for _ in range(num): | ||||
ctx.vin.append(CTxIn(COutPoint(txid, int(utxo["vout"])), b"")) | ctx.vin.append(CTxIn(COutPoint(txid, int(utxo["vout"])), b"")) | ||||
ctx.vout.append(CTxOut(0, CScript( | ctx.vout.append(CTxOut(0, CScript( | ||||
[OP_RETURN, OP_PUSHDATA2, len(padding), bytes(padding, 'utf-8')]))) | [OP_RETURN, OP_PUSHDATA2, len(padding), bytes(padding, 'utf-8')]))) | ||||
ctx.vout.append( | ctx.vout.append( | ||||
CTxOut(int(satoshi_round(utxo['amount']*COIN)), | CTxOut(int(satoshi_round(utxo['amount']*COIN)), | ||||
CScript([OP_DUP, OP_HASH160, addrHash, OP_EQUALVERIFY, OP_CHECKSIG]))) | CScript([OP_DUP, OP_HASH160, addrHash, OP_EQUALVERIFY, OP_CHECKSIG]))) | ||||
# Create a proper fee for the transaction to be mined | # Create a proper fee for the transaction to be mined | ||||
ctx.vout[1].nValue -= int(fee_multiplier * node.calculate_fee(ctx)) | ctx.vout[1].nValue -= int(fee_multiplier * node.calculate_fee(ctx)) | ||||
signresult = node.signrawtransaction( | signresult = node.signrawtransactionwithwallet( | ||||
ToHex(ctx), None, None, "NONE|FORKID") | ToHex(ctx), None, "NONE|FORKID") | ||||
txid = node.sendrawtransaction(signresult["hex"], True) | txid = node.sendrawtransaction(signresult["hex"], True) | ||||
txids.append(txid) | txids.append(txid) | ||||
return txids | return txids |