MCPcopy Create free account
hub / github.com/ElementsProject/elements / spend_one_input

Function spend_one_input

test/functional/wallet_bumpfee.py:586–596  ·  view source on GitHub ↗
(node, dest_address, change_size=Decimal("0.00049000"))

Source from the content-addressed store, hash-verified

584
585
586def spend_one_input(node, dest_address, change_size=Decimal("0.00049000")):
587 tx_input = dict(
588 sequence=BIP125_SEQUENCE_NUMBER, **next(u for u in node.listunspent() if u["amount"] == Decimal("0.00100000")))
589 destinations = [{dest_address: Decimal("0.00050000")}]
590 if change_size > 0:
591 destinations.append({node.getrawchangeaddress(): change_size})
592 destinations.append({"fee": Decimal("0.00001")})
593 rawtx = node.createrawtransaction([tx_input], destinations)
594 signedtx = node.signrawtransactionwithwallet(rawtx)
595 txid = node.sendrawtransaction(signedtx["hex"])
596 return txid
597
598
599def submit_block_with_tx(node, tx):

Callers 12

test_dust_to_feeFunction · 0.70
test_settxfeeFunction · 0.70
test_maxtxfee_failsFunction · 0.70
test_rebumpingFunction · 0.70
test_locked_wallet_failsFunction · 0.70
test_change_script_matchFunction · 0.70

Calls 1

sendrawtransactionMethod · 0.80

Tested by 12

test_dust_to_feeFunction · 0.56
test_settxfeeFunction · 0.56
test_maxtxfee_failsFunction · 0.56
test_rebumpingFunction · 0.56
test_locked_wallet_failsFunction · 0.56
test_change_script_matchFunction · 0.56