Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/wallet.py
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | def send_self_transfer(self, *, fee_rate=Decimal("3000.00"), from_node, | ||||
tx = CTransaction() | tx = CTransaction() | ||||
tx.vin = [CTxIn(COutPoint(int(utxo_to_spend['txid'], 16), | tx.vin = [CTxIn(COutPoint(int(utxo_to_spend['txid'], 16), | ||||
utxo_to_spend['vout']))] | utxo_to_spend['vout']))] | ||||
tx.vout = [CTxOut(int(send_value * XEC), self._scriptPubKey)] | tx.vout = [CTxOut(int(send_value * XEC), self._scriptPubKey)] | ||||
tx.vin[0].scriptSig = SCRIPTSIG_OP_TRUE | tx.vin[0].scriptSig = SCRIPTSIG_OP_TRUE | ||||
pad_tx(tx, size) | pad_tx(tx, size) | ||||
tx_hex = tx.serialize().hex() | tx_hex = tx.serialize().hex() | ||||
txid = from_node.sendrawtransaction(tx_hex) | tx_info = from_node.testmempoolaccept([tx_hex])[0] | ||||
self._utxos.append({'txid': txid, 'vout': 0, 'value': send_value}) | self._utxos.append( | ||||
tx_info = from_node.getmempoolentry(txid) | {'txid': tx_info['txid'], 'vout': 0, 'value': send_value}) | ||||
from_node.sendrawtransaction(tx_hex) | |||||
assert_equal(tx_info['size'], size) | assert_equal(tx_info['size'], size) | ||||
assert_equal(tx_info['fee'], fee) | assert_equal(tx_info['fees']['base'], fee) | ||||
return {'txid': txid, 'hex': tx_hex} | return {'txid': tx_info['txid'], 'hex': tx_hex} |