Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_psbt.py
Show First 20 Lines • Show All 390 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
assert_raises_rpc_error(-8, | assert_raises_rpc_error(-8, | ||||
"At least two PSBTs are required to join PSBTs.", self.nodes[1].joinpsbts, []) | "At least two PSBTs are required to join PSBTs.", self.nodes[1].joinpsbts, []) | ||||
assert_raises_rpc_error(-8, | assert_raises_rpc_error(-8, | ||||
"At least two PSBTs are required to join PSBTs.", self.nodes[1].joinpsbts, [psbt2]) | "At least two PSBTs are required to join PSBTs.", self.nodes[1].joinpsbts, [psbt2]) | ||||
# Check that joining shuffles the inputs and outputs | # Check that joining shuffles the inputs and outputs | ||||
# 10 attempts should be enough to get a shuffled join | # 10 attempts should be enough to get a shuffled join | ||||
shuffled = False | shuffled = False | ||||
for i in range(0, 10): | for _ in range(10): | ||||
shuffled_joined = self.nodes[0].joinpsbts([psbt, psbt2]) | shuffled_joined = self.nodes[0].joinpsbts([psbt, psbt2]) | ||||
shuffled |= joined != shuffled_joined | shuffled |= joined != shuffled_joined | ||||
if shuffled: | if shuffled: | ||||
break | break | ||||
assert shuffled | assert shuffled | ||||
# Newly created PSBT needs UTXOs and updating | # Newly created PSBT needs UTXOs and updating | ||||
addr = self.nodes[1].getnewaddress("") | addr = self.nodes[1].getnewaddress("") | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |