mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 13:32:47 +01:00
Move tx version 2 standardness check to after bip68 activation
This commit is contained in:
parent
99c0e81b95
commit
f5aba8a3c5
@ -51,12 +51,13 @@ class BIP68Test(BitcoinTestFramework):
|
|||||||
print("Running test BIP68 not consensus before versionbits activation")
|
print("Running test BIP68 not consensus before versionbits activation")
|
||||||
self.test_bip68_not_consensus()
|
self.test_bip68_not_consensus()
|
||||||
|
|
||||||
print("Verifying nVersion=2 transactions are standard")
|
|
||||||
self.test_version2_relay()
|
|
||||||
|
|
||||||
print("Activating BIP68 (and 112/113)")
|
print("Activating BIP68 (and 112/113)")
|
||||||
self.activateCSV()
|
self.activateCSV()
|
||||||
|
|
||||||
|
print("Verifying nVersion=2 transactions are standard.")
|
||||||
|
print("Note that with current versions of bitcoin software, nVersion=2 transactions are always standard (independent of BIP68 activation status).")
|
||||||
|
self.test_version2_relay()
|
||||||
|
|
||||||
print("Passed\n")
|
print("Passed\n")
|
||||||
|
|
||||||
# Test that BIP68 is not in effect if tx version is 1, or if
|
# Test that BIP68 is not in effect if tx version is 1, or if
|
||||||
@ -396,7 +397,16 @@ class BIP68Test(BitcoinTestFramework):
|
|||||||
self.nodes[0].submitblock(ToHex(block))
|
self.nodes[0].submitblock(ToHex(block))
|
||||||
assert_equal(self.nodes[0].getbestblockhash(), block.hash)
|
assert_equal(self.nodes[0].getbestblockhash(), block.hash)
|
||||||
|
|
||||||
# Use self.nodes[1] to test that version 2 transactions are standard even before BIP68 activation.
|
def activateCSV(self):
|
||||||
|
# activation should happen at block height 432 (3 periods)
|
||||||
|
min_activation_height = 432
|
||||||
|
height = self.nodes[0].getblockcount()
|
||||||
|
assert(height < 432)
|
||||||
|
self.nodes[0].generate(432-height)
|
||||||
|
assert(get_bip9_status(self.nodes[0], 'csv')['status'] == 'active')
|
||||||
|
sync_blocks(self.nodes)
|
||||||
|
|
||||||
|
# Use self.nodes[1] to test that version 2 transactions are standard.
|
||||||
def test_version2_relay(self):
|
def test_version2_relay(self):
|
||||||
inputs = [ ]
|
inputs = [ ]
|
||||||
outputs = { self.nodes[1].getnewaddress() : 1.0 }
|
outputs = { self.nodes[1].getnewaddress() : 1.0 }
|
||||||
@ -407,14 +417,5 @@ class BIP68Test(BitcoinTestFramework):
|
|||||||
tx_signed = self.nodes[1].signrawtransaction(ToHex(tx))["hex"]
|
tx_signed = self.nodes[1].signrawtransaction(ToHex(tx))["hex"]
|
||||||
tx_id = self.nodes[1].sendrawtransaction(tx_signed)
|
tx_id = self.nodes[1].sendrawtransaction(tx_signed)
|
||||||
|
|
||||||
def activateCSV(self):
|
|
||||||
# activation should happen at block height 432 (3 periods)
|
|
||||||
min_activation_height = 432
|
|
||||||
height = self.nodes[0].getblockcount()
|
|
||||||
assert(height < 432)
|
|
||||||
self.nodes[0].generate(432-height)
|
|
||||||
assert(get_bip9_status(self.nodes[0], 'csv')['status'] == 'active')
|
|
||||||
sync_blocks(self.nodes)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
BIP68Test().main()
|
BIP68Test().main()
|
||||||
|
Loading…
Reference in New Issue
Block a user