Skip to content

Commit 9d5fcbf

Browse files
committed
Merge #9739: Fix BIP68 activation test
f5aba8a Move tx version 2 standardness check to after bip68 activation (John Newbery) 99c0e81 Fix BIP68 activation test (John Newbery) Tree-SHA512: 3633d5359705b33a22cd3d8ea28f41abd93ccc6fe9943c8004f6149add991771df9ea12b4e14192e39e14b414bb5ecc7218e516cfeec97e4c5df29778ac57060
2 parents 48c3429 + f5aba8a commit 9d5fcbf

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

qa/rpc-tests/bip68-sequence.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,12 @@ def run_test(self):
4646
print("Running test BIP68 not consensus before versionbits activation")
4747
self.test_bip68_not_consensus()
4848

49-
print("Verifying nVersion=2 transactions aren't standard")
50-
self.test_version2_relay(before_activation=True)
51-
5249
print("Activating BIP68 (and 112/113)")
5350
self.activateCSV()
5451

55-
print("Verifying nVersion=2 transactions are now standard")
56-
self.test_version2_relay(before_activation=False)
52+
print("Verifying nVersion=2 transactions are standard.")
53+
print("Note that with current versions of bitcoin software, nVersion=2 transactions are always standard (independent of BIP68 activation status).")
54+
self.test_version2_relay()
5755

5856
print("Passed\n")
5957

@@ -403,21 +401,16 @@ def activateCSV(self):
403401
assert(get_bip9_status(self.nodes[0], 'csv')['status'] == 'active')
404402
sync_blocks(self.nodes)
405403

406-
# Use self.nodes[1] to test standardness relay policy
407-
def test_version2_relay(self, before_activation):
404+
# Use self.nodes[1] to test that version 2 transactions are standard.
405+
def test_version2_relay(self):
408406
inputs = [ ]
409407
outputs = { self.nodes[1].getnewaddress() : 1.0 }
410408
rawtx = self.nodes[1].createrawtransaction(inputs, outputs)
411409
rawtxfund = self.nodes[1].fundrawtransaction(rawtx)['hex']
412410
tx = FromHex(CTransaction(), rawtxfund)
413411
tx.nVersion = 2
414412
tx_signed = self.nodes[1].signrawtransaction(ToHex(tx))["hex"]
415-
try:
416-
tx_id = self.nodes[1].sendrawtransaction(tx_signed)
417-
assert(before_activation == False)
418-
except:
419-
assert(before_activation)
420-
413+
tx_id = self.nodes[1].sendrawtransaction(tx_signed)
421414

422415
if __name__ == '__main__':
423416
BIP68Test().main()

0 commit comments

Comments
 (0)