Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_fundrawtransaction.py
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# = 2 bytes * minRelayTxFeePerByte | # = 2 bytes * minRelayTxFeePerByte | ||||
feeTolerance = 2 * min_relay_tx_fee / 1000 | feeTolerance = 2 * min_relay_tx_fee / 1000 | ||||
self.nodes[2].generate(1) | self.nodes[2].generate(1) | ||||
self.sync_all() | self.sync_all() | ||||
self.nodes[0].generate(121) | self.nodes[0].generate(121) | ||||
self.sync_all() | self.sync_all() | ||||
# ensure that setting changePosition in fundraw with an exact match is handled properly | |||||
rawmatch = self.nodes[2].createrawtransaction( | |||||
[], {self.nodes[2].getnewaddress(): 50}) | |||||
rawmatch = self.nodes[2].fundrawtransaction( | |||||
rawmatch, {"changePosition": 1, "subtractFeeFromOutputs": [0]}) | |||||
assert_equal(rawmatch["changepos"], -1) | |||||
watchonly_address = self.nodes[0].getnewaddress() | watchonly_address = self.nodes[0].getnewaddress() | ||||
watchonly_pubkey = self.nodes[ | watchonly_pubkey = self.nodes[ | ||||
0].validateaddress(watchonly_address)["pubkey"] | 0].validateaddress(watchonly_address)["pubkey"] | ||||
watchonly_amount = Decimal(200) | watchonly_amount = Decimal(200) | ||||
self.nodes[3].importpubkey(watchonly_pubkey, "", True) | self.nodes[3].importpubkey(watchonly_pubkey, "", True) | ||||
watchonly_txid = self.nodes[0].sendtoaddress( | watchonly_txid = self.nodes[0].sendtoaddress( | ||||
watchonly_address, watchonly_amount) | watchonly_address, watchonly_amount) | ||||
self.nodes[0].sendtoaddress( | self.nodes[0].sendtoaddress( | ||||
▲ Show 20 Lines • Show All 716 Lines • Show Last 20 Lines |