Skip to content

Commit f49f0a2

Browse files
authored
Merge pull request ElementsProject#1481 from tomt1664/fix/feature_pak_test
test: fix feature_pak.py test
2 parents b1749fb + da9d7c1 commit f49f0a2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/functional/feature_pak.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ def run_test(self):
109109

110110
# Node 1 will now make a PAK peg-out, accepted in all mempools and blocks
111111
pegout_info = self.nodes[1].sendtomainchain("", 1)
112-
print(pegout_info)
113112
raw_node1_pegout = self.nodes[1].gettransaction(pegout_info["txid"])["hex"]
114113
self.sync_all() # mempool sync
115114
self.generatetoaddress(self.nodes[1], 1, self.nodes[0].getnewaddress(), sync_fun=self.no_op)
@@ -224,7 +223,6 @@ def run_test(self):
224223

225224
peg_out_found = False
226225
for output in wpkh_raw["vout"]:
227-
print(output)
228226
if "pegout_address" in output["scriptPubKey"]:
229227
if output["scriptPubKey"]["pegout_address"] == wpkh_info["address_lookahead"][0]:
230228
peg_out_found = True
@@ -248,6 +246,8 @@ def run_test(self):
248246
for tx_id in [wpkh_txid, sh_wpkh_txid]:
249247
assert_greater_than(self.nodes[1].gettransaction(tx_id)["confirmations"], 0)
250248

249+
self.sync_blocks()
250+
251251
self.log.info("Test that pak-less pegouts are rejected")
252252

253253
# Last test of a pak-less peg-out failing to get into mempool/block
@@ -256,7 +256,10 @@ def run_test(self):
256256

257257
# node 0 will now create a pegout, will fail to enter mempool of node 1 or 2
258258
# since it's pak-less
259-
nopak_pegout_txid = self.nodes[0].sendtomainchain("n3NkSZqoPMCQN5FENxUBw4qVATbytH6FDK", 1)
259+
pegout_address = "n3NkSZqoPMCQN5FENxUBw4qVATbytH6FDK"
260+
nopak_pegout_txid = self.nodes[0].sendtomainchain(pegout_address, 1)
261+
pegout_tx = self.nodes[0].gettransaction(nopak_pegout_txid,True,True)
262+
assert_equal(pegout_tx["decoded"]["vout"][[d["value"] for d in pegout_tx["decoded"]["vout"]].index(1)]["scriptPubKey"]["pegout_address"],pegout_address)
260263
raw_pakless_pegout = self.nodes[0].gettransaction(nopak_pegout_txid)["hex"]
261264
assert nopak_pegout_txid in self.nodes[0].getrawmempool()
262265

0 commit comments

Comments
 (0)