I have tried to make this work, but first I’d have to change valid_witness_malleate_tx to also return the parent
return parent, child_one, child_two
and then 👇🏽
0
1 siblings_parent, sibling1, sibling2 = valid_witness_malleate_tx(wallet, tx_originator)
2 self.log.info(f" - sibling1: txid={sibling1.txid_hex}, wtxid={sibling1.wtxid_hex}")
3 self.log.info(f" - sibling2: txid={sibling2.txid_hex}, wtxid={sibling2.wtxid_hex}")
4 import pdb; pdb.set_trace()
5 assert_equal(sibling1.txid_hex, sibling2.txid_hex)
6 assert_not_equal(sibling1.wtxid_hex, sibling2.wtxid_hex)
7 assert_equal(len(tx_originator.getrawmempool()), 1) # Should be 1 from previous test
8 parent_raw = siblings_parent['hex']
9 parent_tx = tx_from_hex(parent_raw)
10 tx_returner.send_without_ping(msg_tx(parent_tx))
11 self.wait_until(lambda: len(tx_originator.getrawmempool()) > 1)
12 self.log.info(" - siblings' parent added to the mempool")
13 tx_originator.sendrawtransaction(hexstring=sibling1.serialize_with_witness().hex(), maxfeerate=0.1)
14 self.log.info(" - sent sibling1: ok")
15 ignoring_msg = f"Ignoring unnecessary request to schedule an already scheduled transaction: txid={sibling2.txid_hex}, wtxid={sibling2.wtxid_hex}"
16 with tx_originator.busy_wait_for_debug_log(expected_msgs=[ignoring_msg.encode()]):
17 tx_originator.sendrawtransaction(hexstring=sibling2.serialize_with_witness().hex(), maxfeerate=0.1)
18 self.log.info(" - sibling2 rejected because it has the same txid: ok")