Skip to content

Commit f079c60

Browse files
committed
feature_fedpeg.py: just use testmempoolaccept checking blinded peg-in transactions
1 parent ee14d88 commit f079c60

1 file changed

Lines changed: 4 additions & 14 deletions

File tree

test/functional/feature_fedpeg.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from test_framework.test_framework import BitcoinTestFramework
77
from test_framework.util import (
88
connect_nodes_bi,
9-
disconnect_nodes,
109
get_auth_cookie,
1110
get_datadir_path,
1211
rpc_port,
@@ -615,23 +614,14 @@ def run_test(self):
615614
assert(final_decoded["vout"][1]["commitmentnonce_fully_valid"])
616615
assert("value" in final_decoded["vout"][2])
617616
assert("asset" in final_decoded["vout"][2])
618-
# check that it is accepted in the mempool
617+
# check that it is accepted in either mempool
619618
accepted = sidechain.testmempoolaccept([pegin_signed["hex"]])[0]
619+
if not accepted["allowed"]:
620+
raise Exception(accepted["reject-reason"])
621+
accepted = sidechain2.testmempoolaccept([pegin_signed["hex"]])[0]
620622
if not accepted["allowed"]:
621623
raise Exception(accepted["reject-reason"])
622624
print("Blinded transaction looks ok!") # need this print to distinguish failures in for loop
623-
# check if they get mined; since we're trying to mine two double spends, disconnect the nodes
624-
disconnect_nodes(sidechain, 3)
625-
disconnect_nodes(sidechain2, 2)
626-
txid1 = sidechain.sendrawtransaction(pegin_signed1["hex"])
627-
blocks = sidechain.generate(3)
628-
assert_equal(sidechain.getrawtransaction(txid1, True, blocks[0])["confirmations"], 3)
629-
txid2 = sidechain2.sendrawtransaction(pegin_signed2["hex"])
630-
blocks = sidechain2.generate(3)
631-
assert_equal(sidechain2.getrawtransaction(txid2, True, blocks[0])["confirmations"], 3)
632-
# reconnect in case we extend the test
633-
connect_nodes_bi(self.nodes, 2, 3)
634-
sidechain.generate(10)
635625

636626
print('Success!')
637627

0 commit comments

Comments
 (0)