qa: correct create_spend functional test
Both transactions may not spend the same coins. We need to compare the set of all der paths across inputs.
This commit is contained in:
parent
cf33228b0d
commit
8d213d5e31
@ -398,11 +398,15 @@ def test_create_spend(lianad, bitcoind):
|
||||
res_spend = lianad.rpc.createspend(destinations, outpoints, 1)
|
||||
res_reco = lianad.rpc.createrecovery(bitcoind.rpc.getnewaddress(), 2)
|
||||
|
||||
# The two PSBTs don't share any BIP32 derivation paths in their input.
|
||||
# The two PSBTs don't share any BIP32 derivation paths in their inputs.
|
||||
res_spend_psbt = PSBT.from_base64(res_spend["psbt"])
|
||||
res_spend_keys = set()
|
||||
for i in res_spend_psbt.i:
|
||||
res_spend_keys = res_spend_keys | set(i.map[PSBT_IN_BIP32_DERIVATION])
|
||||
res_reco_psbt = PSBT.from_base64(res_reco["psbt"])
|
||||
res_spend_keys = set(res_spend_psbt.i[0].map[PSBT_IN_BIP32_DERIVATION])
|
||||
res_reco_keys = set(res_reco_psbt.i[0].map[PSBT_IN_BIP32_DERIVATION])
|
||||
res_reco_keys = set()
|
||||
for i in res_reco_psbt.i:
|
||||
res_reco_keys = res_reco_keys | set(i.map[PSBT_IN_BIP32_DERIVATION])
|
||||
assert res_spend_keys.intersection(res_reco_keys) == set()
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user