Changeset View
Changeset View
Standalone View
Standalone View
test/functional/fundrawtransaction.py
Show First 20 Lines • Show All 647 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
outputs = {self.nodes[3].getnewaddress(): 1} | outputs = {self.nodes[3].getnewaddress(): 1} | ||||
rawtx = self.nodes[3].createrawtransaction(inputs, outputs) | rawtx = self.nodes[3].createrawtransaction(inputs, outputs) | ||||
result = self.nodes[3].fundrawtransaction( | result = self.nodes[3].fundrawtransaction( | ||||
rawtx) # uses min_relay_tx_fee (set by settxfee) | rawtx) # uses min_relay_tx_fee (set by settxfee) | ||||
result2 = self.nodes[3].fundrawtransaction( | result2 = self.nodes[3].fundrawtransaction( | ||||
rawtx, {"feeRate": 2 * min_relay_tx_fee}) | rawtx, {"feeRate": 2 * min_relay_tx_fee}) | ||||
result3 = self.nodes[3].fundrawtransaction( | result3 = self.nodes[3].fundrawtransaction( | ||||
rawtx, {"feeRate": 10 * min_relay_tx_fee}) | rawtx, {"feeRate": 10 * min_relay_tx_fee}) | ||||
result_fee_rate = result['fee'] * 1000 / count_bytes(result['hex']) | |||||
assert_fee_amount( | assert_fee_amount( | ||||
result2['fee'], FromHex(CTransaction(), result2['hex']).billable_size(), 2 * min_relay_tx_fee) | result2['fee'], FromHex(CTransaction(), result2['hex']).billable_size(), 2 * result_fee_rate) | ||||
assert_fee_amount( | assert_fee_amount( | ||||
result3['fee'], FromHex(CTransaction(), result3['hex']).billable_size(), 10 * min_relay_tx_fee) | result3['fee'], FromHex(CTransaction(), result3['hex']).billable_size(), 10 * result_fee_rate) | ||||
# | # | ||||
# Test address reuse option # | # Test address reuse option # | ||||
# | # | ||||
result3 = self.nodes[3].fundrawtransaction( | result3 = self.nodes[3].fundrawtransaction( | ||||
rawtx, {"reserveChangeKey": False}) | rawtx, {"reserveChangeKey": False}) | ||||
res_dec = self.nodes[0].decoderawtransaction(result3["hex"]) | res_dec = self.nodes[0].decoderawtransaction(result3["hex"]) | ||||
▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines |