Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_psbt.py
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
walletprocesspsbt_out = self.nodes[1].walletprocesspsbt(rawtx) | walletprocesspsbt_out = self.nodes[1].walletprocesspsbt(rawtx) | ||||
# Make sure it has UTXOs | # Make sure it has UTXOs | ||||
decoded = self.nodes[1].decodepsbt(walletprocesspsbt_out['psbt']) | decoded = self.nodes[1].decodepsbt(walletprocesspsbt_out['psbt']) | ||||
assert 'utxo' in decoded['inputs'][0] | assert 'utxo' in decoded['inputs'][0] | ||||
assert_equal(walletprocesspsbt_out['complete'], True) | assert_equal(walletprocesspsbt_out['complete'], True) | ||||
self.nodes[1].sendrawtransaction( | self.nodes[1].sendrawtransaction( | ||||
self.nodes[1].finalizepsbt(walletprocesspsbt_out['psbt'])['hex']) | self.nodes[1].finalizepsbt(walletprocesspsbt_out['psbt'])['hex']) | ||||
# feeRate of 0.1 BCH / KB produces a total fee slightly below -maxtxfee | # feeRate of 100,000 XEC / KB produces a total fee slightly below | ||||
# -maxtxfee | |||||
res = self.nodes[1].walletcreatefundedpsbt( | res = self.nodes[1].walletcreatefundedpsbt( | ||||
[ | [ | ||||
{ | { | ||||
"txid": txid, "vout": p2sh_pos}, { | "txid": txid, "vout": p2sh_pos}, { | ||||
"txid": txid, "vout": p2pkh_pos}], { | "txid": txid, "vout": p2pkh_pos}], { | ||||
self.nodes[1].getnewaddress(): 29990000}, 0, { | self.nodes[1].getnewaddress(): 29990000}, 0, { | ||||
"feeRate": 100000, "add_inputs": True}) | "feeRate": 100000, "add_inputs": True}) | ||||
assert_approx(res["fee"], 65000, 5000) | assert_approx(res["fee"], 65000, 5000) | ||||
# feeRate of 10 BCH / KB produces a total fee well above -maxtxfee | # feeRate of 10,000,000 XEC / KB produces a total fee well above -maxtxfee | ||||
# previously this was silently capped at -maxtxfee | # previously this was silently capped at -maxtxfee | ||||
assert_raises_rpc_error(-4, | assert_raises_rpc_error(-4, | ||||
"Fee exceeds maximum configured by -maxtxfee", | "Fee exceeds maximum configured by -maxtxfee", | ||||
self.nodes[1].walletcreatefundedpsbt, | self.nodes[1].walletcreatefundedpsbt, | ||||
[{"txid": txid, | [{"txid": txid, | ||||
"vout": p2sh_pos}, | "vout": p2sh_pos}, | ||||
{"txid": txid, | {"txid": txid, | ||||
"vout": p2pkh_pos}], | "vout": p2pkh_pos}], | ||||
▲ Show 20 Lines • Show All 339 Lines • Show Last 20 Lines |