Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-wallet-standardness.py
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
wallet_outpoints = {(entry['txid'], entry['vout']) | wallet_outpoints = {(entry['txid'], entry['vout']) | ||||
for entry in std_node.listunspent()} | for entry in std_node.listunspent()} | ||||
# calculate wallet balance change just as a double check | # calculate wallet balance change just as a double check | ||||
balance_change = std_node.getbalance() - balance_initial | balance_change = std_node.getbalance() - balance_initial | ||||
# try spending the funds using the wallet. | # try spending the funds using the wallet. | ||||
outamount = (amount-spendfee) * SATOSHI | outamount = (amount - spendfee) * SATOSHI | ||||
if outamount < 546 * SATOSHI: | if outamount < 546 * SATOSHI: | ||||
# If the final amount would be too small, then just donate | # If the final amount would be too small, then just donate | ||||
# to miner fees. | # to miner fees. | ||||
outputs = [{"data": b"to miner, with love".hex()}] | outputs = [{"data": b"to miner, with love".hex()}] | ||||
else: | else: | ||||
outputs = [{address_nonstd: outamount}] | outputs = [{address_nonstd: outamount}] | ||||
spendtx = std_node.createrawtransaction( | spendtx = std_node.createrawtransaction( | ||||
[{'txid': txid, 'vout': 0}], outputs) | [{'txid': txid, 'vout': 0}], outputs) | ||||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |