Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_fundrawtransaction.py
Show First 20 Lines • Show All 675 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
rawTx, {"feeRate": 10 * min_relay_tx_fee}) | rawTx, {"feeRate": 10 * min_relay_tx_fee}) | ||||
# allow this transaction to be underfunded by 10 bytes. This is due | # allow this transaction to be underfunded by 10 bytes. This is due | ||||
# to the first transaction possibly being overfunded by up to .9 | # to the first transaction possibly being overfunded by up to .9 | ||||
# satoshi due to fee ceilings being used. | # satoshi due to fee ceilings being used. | ||||
assert_fee_amount( | assert_fee_amount( | ||||
result3['fee'], FromHex(CTransaction(), result3['hex']).billable_size(), 10 * result_fee_rate, 10) | result3['fee'], FromHex(CTransaction(), result3['hex']).billable_size(), 10 * result_fee_rate, 10) | ||||
# | # | ||||
# Test address reuse option # | # Test no address reuse occurs # | ||||
# | # | ||||
result3 = self.nodes[3].fundrawtransaction( | |||||
rawTx, {"reserveChangeKey": False}) | |||||
res_dec = self.nodes[0].decoderawtransaction(result3["hex"]) | |||||
changeaddress = "" | |||||
for out in res_dec['vout']: | |||||
if out['value'] > 1.0: | |||||
changeaddress += out['scriptPubKey']['addresses'][0] | |||||
assert(changeaddress != "") | |||||
nextaddr = self.nodes[3].getrawchangeaddress() | |||||
# frt should not have removed the key from the keypool | |||||
assert(changeaddress == nextaddr) | |||||
result3 = self.nodes[3].fundrawtransaction(rawTx) | result3 = self.nodes[3].fundrawtransaction(rawTx) | ||||
res_dec = self.nodes[0].decoderawtransaction(result3["hex"]) | res_dec = self.nodes[0].decoderawtransaction(result3["hex"]) | ||||
changeaddress = "" | changeaddress = "" | ||||
for out in res_dec['vout']: | for out in res_dec['vout']: | ||||
if out['value'] > 1.0: | if out['value'] > 1.0: | ||||
changeaddress += out['scriptPubKey']['addresses'][0] | changeaddress += out['scriptPubKey']['addresses'][0] | ||||
assert(changeaddress != "") | assert(changeaddress != "") | ||||
nextaddr = self.nodes[3].getnewaddress() | nextaddr = self.nodes[3].getnewaddress() | ||||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |