@@ -83,7 +83,7 @@ def test_basic_child_then_parent(self):
8383 peer_sender = node .add_p2p_connection (P2PInterface ())
8484
8585 # 1. Child is received first (perhaps the low feerate parent didn't meet feefilter or the requests were sent to different nodes). It is missing an input.
86- high_child_wtxid_int = int ( high_fee_child ["tx" ].wtxid_hex , 16 )
86+ high_child_wtxid_int = high_fee_child ["tx" ].wtxid_int
8787 peer_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = high_child_wtxid_int )]))
8888 peer_sender .wait_for_getdata ([high_child_wtxid_int ])
8989 peer_sender .send_and_ping (msg_tx (high_fee_child ["tx" ]))
@@ -112,7 +112,7 @@ def test_basic_parent_then_child(self, wallet):
112112 peer_ignored = node .add_outbound_p2p_connection (P2PInterface (), p2p_idx = 2 , connection_type = "outbound-full-relay" )
113113
114114 # 1. Parent is relayed first. It is too low feerate.
115- parent_wtxid_int = int ( low_fee_parent ["tx" ].wtxid_hex , 16 )
115+ parent_wtxid_int = low_fee_parent ["tx" ].wtxid_int
116116 peer_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = parent_wtxid_int )]))
117117 peer_sender .wait_for_getdata ([parent_wtxid_int ])
118118 peer_sender .send_and_ping (msg_tx (low_fee_parent ["tx" ]))
@@ -123,7 +123,7 @@ def test_basic_parent_then_child(self, wallet):
123123 assert "getdata" not in peer_ignored .last_message
124124
125125 # 2. Child is relayed next. It is missing an input.
126- high_child_wtxid_int = int ( high_fee_child ["tx" ].wtxid_hex , 16 )
126+ high_child_wtxid_int = high_fee_child ["tx" ].wtxid_int
127127 peer_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = high_child_wtxid_int )]))
128128 peer_sender .wait_for_getdata ([high_child_wtxid_int ])
129129 peer_sender .send_and_ping (msg_tx (high_fee_child ["tx" ]))
@@ -156,7 +156,7 @@ def test_low_and_high_child(self, wallet):
156156 self .log .info ("Check that tx caches low fee parent + low fee child package rejections" )
157157
158158 # 1. Send parent, rejected for being low feerate.
159- parent_wtxid_int = int ( low_fee_parent ["tx" ].wtxid_hex , 16 )
159+ parent_wtxid_int = low_fee_parent ["tx" ].wtxid_int
160160 peer_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = parent_wtxid_int )]))
161161 peer_sender .wait_for_getdata ([parent_wtxid_int ])
162162 peer_sender .send_and_ping (msg_tx (low_fee_parent ["tx" ]))
@@ -167,7 +167,7 @@ def test_low_and_high_child(self, wallet):
167167 assert "getdata" not in peer_ignored .last_message
168168
169169 # 2. Send an (orphan) child that has a higher feerate, but not enough to bump the parent.
170- med_child_wtxid_int = int ( med_fee_child ["tx" ].wtxid_hex , 16 )
170+ med_child_wtxid_int = med_fee_child ["tx" ].wtxid_int
171171 peer_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = med_child_wtxid_int )]))
172172 peer_sender .wait_for_getdata ([med_child_wtxid_int ])
173173 peer_sender .send_and_ping (msg_tx (med_fee_child ["tx" ]))
@@ -193,7 +193,7 @@ def test_low_and_high_child(self, wallet):
193193 assert med_fee_child ["txid" ] not in node .getrawmempool ()
194194
195195 # 5. Send the high feerate (orphan) child
196- high_child_wtxid_int = int ( high_fee_child ["tx" ].wtxid_hex , 16 )
196+ high_child_wtxid_int = high_fee_child ["tx" ].wtxid_int
197197 peer_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = high_child_wtxid_int )]))
198198 peer_sender .wait_for_getdata ([high_child_wtxid_int ])
199199 peer_sender .send_and_ping (msg_tx (high_fee_child ["tx" ]))
@@ -229,7 +229,7 @@ def test_orphan_consensus_failure(self):
229229 parent_sender = node .add_p2p_connection (P2PInterface ())
230230
231231 # 1. Child is received first. It is missing an input.
232- child_wtxid_int = int ( tx_orphan_bad_wit .wtxid_hex , 16 )
232+ child_wtxid_int = tx_orphan_bad_wit .wtxid_int
233233 bad_orphan_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = child_wtxid_int )]))
234234 bad_orphan_sender .wait_for_getdata ([child_wtxid_int ])
235235 bad_orphan_sender .send_and_ping (msg_tx (tx_orphan_bad_wit ))
@@ -270,13 +270,13 @@ def test_parent_consensus_failure(self):
270270 fake_parent_sender = node .add_p2p_connection (P2PInterface ())
271271
272272 # 1. Child is received first. It is missing an input.
273- child_wtxid_int = int ( high_fee_child ["tx" ].wtxid_hex , 16 )
273+ child_wtxid_int = high_fee_child ["tx" ].wtxid_int
274274 package_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = child_wtxid_int )]))
275275 package_sender .wait_for_getdata ([child_wtxid_int ])
276276 package_sender .send_and_ping (msg_tx (high_fee_child ["tx" ]))
277277
278278 # 2. Node requests the missing parent by txid.
279- parent_txid_int = int ( tx_parent_bad_wit .txid_hex , 16 )
279+ parent_txid_int = tx_parent_bad_wit .txid_int
280280 package_sender .wait_for_getdata ([parent_txid_int ])
281281
282282 # 3. A different node relays the parent. The parent is first evaluated by itself and
@@ -292,7 +292,7 @@ def test_parent_consensus_failure(self):
292292 self .log .info ("Check that fake parent does not cause orphan to be deleted and real package can still be submitted" )
293293 # 5. Child-sending should not have been punished and the orphan should remain in orphanage.
294294 # It can send the "real" parent transaction, and the package is accepted.
295- parent_wtxid_int = int ( low_fee_parent ["tx" ].wtxid_hex , 16 )
295+ parent_wtxid_int = low_fee_parent ["tx" ].wtxid_int
296296 package_sender .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = parent_wtxid_int )]))
297297 package_sender .wait_for_getdata ([parent_wtxid_int ])
298298 package_sender .send_and_ping (msg_tx (low_fee_parent ["tx" ]))
0 commit comments