|
|
@ -46,14 +46,12 @@ 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 aren't standard") |
|
|
|
|
|
|
|
self.test_version2_relay(before_activation=True) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print("Activating BIP68 (and 112/113)") |
|
|
|
print("Activating BIP68 (and 112/113)") |
|
|
|
self.activateCSV() |
|
|
|
self.activateCSV() |
|
|
|
|
|
|
|
|
|
|
|
print("Verifying nVersion=2 transactions are now standard") |
|
|
|
print("Verifying nVersion=2 transactions are standard.") |
|
|
|
self.test_version2_relay(before_activation=False) |
|
|
|
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") |
|
|
|
|
|
|
|
|
|
|
@ -403,8 +401,8 @@ class BIP68Test(BitcoinTestFramework): |
|
|
|
assert(get_bip9_status(self.nodes[0], 'csv')['status'] == 'active') |
|
|
|
assert(get_bip9_status(self.nodes[0], 'csv')['status'] == 'active') |
|
|
|
sync_blocks(self.nodes) |
|
|
|
sync_blocks(self.nodes) |
|
|
|
|
|
|
|
|
|
|
|
# Use self.nodes[1] to test standardness relay policy |
|
|
|
# Use self.nodes[1] to test that version 2 transactions are standard. |
|
|
|
def test_version2_relay(self, before_activation): |
|
|
|
def test_version2_relay(self): |
|
|
|
inputs = [ ] |
|
|
|
inputs = [ ] |
|
|
|
outputs = { self.nodes[1].getnewaddress() : 1.0 } |
|
|
|
outputs = { self.nodes[1].getnewaddress() : 1.0 } |
|
|
|
rawtx = self.nodes[1].createrawtransaction(inputs, outputs) |
|
|
|
rawtx = self.nodes[1].createrawtransaction(inputs, outputs) |
|
|
@ -412,12 +410,7 @@ class BIP68Test(BitcoinTestFramework): |
|
|
|
tx = FromHex(CTransaction(), rawtxfund) |
|
|
|
tx = FromHex(CTransaction(), rawtxfund) |
|
|
|
tx.nVersion = 2 |
|
|
|
tx.nVersion = 2 |
|
|
|
tx_signed = self.nodes[1].signrawtransaction(ToHex(tx))["hex"] |
|
|
|
tx_signed = self.nodes[1].signrawtransaction(ToHex(tx))["hex"] |
|
|
|
try: |
|
|
|
tx_id = self.nodes[1].sendrawtransaction(tx_signed) |
|
|
|
tx_id = self.nodes[1].sendrawtransaction(tx_signed) |
|
|
|
|
|
|
|
assert(before_activation == False) |
|
|
|
|
|
|
|
except: |
|
|
|
|
|
|
|
assert(before_activation) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
if __name__ == '__main__': |
|
|
|
BIP68Test().main() |
|
|
|
BIP68Test().main() |
|
|
|