From c82db45e83aea70e3eab53e2b4a971a80ea49cb8 Mon Sep 17 00:00:00 2001 From: Jude Nelson Date: Thu, 29 Sep 2016 12:31:56 -0400 Subject: [PATCH] set the appropriate epoch envars and use the new epoch config API, now that the test framework defaults to epoch 1 --- ..._preorder_register_nextepoch_expire_reregister.py | 7 +++---- .../name_preorder_register_nextepoch_renew.py | 10 +++++----- .../name_preorder_register_reregister_newowner.py | 5 +++++ .../name_preorder_register_reregister_sameowner.py | 7 +++++++ .../name_preorder_register_revoke_isdead.py | 12 +++++++++++- .../name_preorder_register_revoke_reregister.py | 12 +++++++++++- ...e_preorder_register_revoke_reregister_newowner.py | 12 +++++++++++- ...ister_transfer_update_expire_reregister_delays.py | 5 +++++ ...ansfer_update_expire_reregister_delays_failure.py | 6 ++++++ 9 files changed, 64 insertions(+), 12 deletions(-) diff --git a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_nextepoch_expire_reregister.py b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_nextepoch_expire_reregister.py index f21d3daf3..c749629b4 100644 --- a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_nextepoch_expire_reregister.py +++ b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_nextepoch_expire_reregister.py @@ -66,8 +66,7 @@ def scenario( wallets, **kw ): testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr ) testlib.next_block( **kw ) - old_namespace_lifetime = blockstack_server.config.get_epoch_namespace_lifetime_multiplier( testlib.get_current_block(**kw) ) - for i in xrange(0, 5 * old_namespace_lifetime): + for i in xrange(0, 5): testlib.next_block( **kw ) # epoch shifts here @@ -75,7 +74,7 @@ def scenario( wallets, **kw ): testlib.next_block( **kw ) # actually expire - for i in xrange(0, 5 * blockstack_server.config.get_epoch_namespace_lifetime_multiplier( testlib.get_current_block(**kw) ) - 5 * old_namespace_lifetime): + for i in xrange(0, 5 * blockstack_server.config.get_epoch_namespace_lifetime_multiplier( testlib.get_current_block(**kw), "test" ) - 5): testlib.next_block( **kw ) # should work now @@ -94,7 +93,7 @@ def check( state_engine ): global last_first_block, first_preorder original_price = 6400000 - curr_price = original_price * blockstack_server.lib.config.EPOCHS[1]['PRICE_MULTIPLIER'] + curr_price = original_price * blockstack_server.lib.config.get_epoch_price_multiplier( 267, "test" ) # not revealed, but ready ns = state_engine.get_namespace_reveal( "test" ) diff --git a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_nextepoch_renew.py b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_nextepoch_renew.py index e6aa171e6..c227d7b44 100644 --- a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_nextepoch_renew.py +++ b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_nextepoch_renew.py @@ -64,8 +64,8 @@ def scenario( wallets, **kw ): # next epoch takes effect... testlib.next_block( **kw ) - # wait for a bit more (namespace lifetime should have doubled) - for i in xrange(0, 10): + # wait for a bit more (namespace lifetime should have 5x'ed) + for i in xrange(0, 40): testlib.next_block( **kw ) resp = testlib.blockstack_name_renew( "foo.test", wallets[3].privkey ) @@ -79,7 +79,7 @@ def scenario( wallets, **kw ): def check( state_engine ): original_price = 6400000 - curr_price = original_price * blockstack_server.lib.config.EPOCHS[1]['PRICE_MULTIPLIER'] + curr_price = original_price * blockstack_server.lib.config.get_epoch_price_multiplier( 273, "test" ) # not revealed, but ready ns = state_engine.get_namespace_reveal( "test" ) @@ -107,8 +107,8 @@ def check( state_engine ): if name_rec['address'] != wallets[3].addr or name_rec['sender'] != pybitcoin.make_pay_to_address_script(wallets[3].addr): return False - # renewed (22 blocks later) - if name_rec['last_renewed'] - 22 != name_rec['first_registered']: + # renewed (52 blocks later) + if name_rec['last_renewed'] - 52 != name_rec['first_registered']: print name_rec['last_renewed'] print name_rec['first_registered'] return False diff --git a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_reregister_newowner.py b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_reregister_newowner.py index 8e7be1111..5a182babe 100644 --- a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_reregister_newowner.py +++ b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_reregister_newowner.py @@ -25,6 +25,11 @@ import testlib import pybitcoin import json +# in epoch 2 immediately, but with the old price (in order to test compatibility with 0.13) +""" +TEST ENV BLOCKSTACK_EPOCH_1_END_BLOCK 250 +TEST ENV BLOCKSTACK_EPOCH_2_PRICE_MULTIPLIER 1.0 +""" wallets = [ testlib.Wallet( "5JesPiN68qt44Hc2nT8qmyZ1JDwHebfoh9KQ52Lazb1m1LaKNj9", 100000000000 ), testlib.Wallet( "5KHqsiU9qa77frZb6hQy9ocV7Sus9RWJcQGYYBJJBb2Efj1o77e", 100000000000 ), diff --git a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_reregister_sameowner.py b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_reregister_sameowner.py index 1ccc0b7d2..6be5c0678 100644 --- a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_reregister_sameowner.py +++ b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_reregister_sameowner.py @@ -25,6 +25,11 @@ import testlib import pybitcoin import json +# in epoch 2 immediately, but with the old price (in order to test compatibility with 0.13) +""" +TEST ENV BLOCKSTACK_EPOCH_1_END_BLOCK 250 +TEST ENV BLOCKSTACK_EPOCH_2_PRICE_MULTIPLIER 1.0 +""" wallets = [ testlib.Wallet( "5JesPiN68qt44Hc2nT8qmyZ1JDwHebfoh9KQ52Lazb1m1LaKNj9", 100000000000 ), testlib.Wallet( "5KHqsiU9qa77frZb6hQy9ocV7Sus9RWJcQGYYBJJBb2Efj1o77e", 100000000000 ), @@ -39,6 +44,8 @@ first_preorder = None def scenario( wallets, **kw ): + global last_first_block, first_preorder + testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey ) testlib.next_block( **kw ) diff --git a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_revoke_isdead.py b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_revoke_isdead.py index d8df60bce..443d0e708 100644 --- a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_revoke_isdead.py +++ b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_revoke_isdead.py @@ -25,7 +25,13 @@ import testlib import pybitcoin import json import blockstack as blockstack_server +import sys +# in epoch 2 immediately, but with the old price (in order to test compatibility with 0.13) +""" +TEST ENV BLOCKSTACK_EPOCH_1_END_BLOCK 250 +TEST ENV BLOCKSTACK_EPOCH_2_PRICE_MULTIPLIER 1.0 +""" wallets = [ testlib.Wallet( "5JesPiN68qt44Hc2nT8qmyZ1JDwHebfoh9KQ52Lazb1m1LaKNj9", 100000000000 ), testlib.Wallet( "5KHqsiU9qa77frZb6hQy9ocV7Sus9RWJcQGYYBJJBb2Efj1o77e", 100000000000 ), @@ -89,7 +95,7 @@ def scenario( wallets, **kw ): for i in xrange(0, 8 * NAMESPACE_LIFETIME_MULTIPLIER): testlib.next_block( **kw ) - # verify that operations continue to fail + # verify that operations continue to fail (BUG IN 0.13: THIS SUCCEEDS HWEN IT SHOULD FAIL) resp = testlib.blockstack_name_update( "foo.test", "11" * 20, wallets[3].privkey, safety_checks=False ) if 'error' in resp: print json.dumps( resp, indent=4 ) @@ -113,6 +119,10 @@ def scenario( wallets, **kw ): testlib.next_block( **kw ) fail_blocks.append( testlib.get_current_block( **kw ) ) + # warn the serialization checker that this changes behavior from 0.13 + print "BLOCKSTACK_SERIALIZATION_CHANGE_BEHAVIOR" + sys.stdout.flush() + def check( state_engine ): diff --git a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_revoke_reregister.py b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_revoke_reregister.py index 802488906..cd368afb5 100644 --- a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_revoke_reregister.py +++ b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_revoke_reregister.py @@ -25,7 +25,13 @@ import testlib import pybitcoin import json import blockstack as blockstack_server +import sys +# in epoch 2 immediately, but with the old price (in order to test compatibility with 0.13) +""" +TEST ENV BLOCKSTACK_EPOCH_1_END_BLOCK 250 +TEST ENV BLOCKSTACK_EPOCH_2_PRICE_MULTIPLIER 1.0 +""" wallets = [ testlib.Wallet( "5JesPiN68qt44Hc2nT8qmyZ1JDwHebfoh9KQ52Lazb1m1LaKNj9", 100000000000 ), testlib.Wallet( "5KHqsiU9qa77frZb6hQy9ocV7Sus9RWJcQGYYBJJBb2Efj1o77e", 100000000000 ), @@ -85,7 +91,7 @@ def scenario( wallets, **kw ): for i in xrange(0, 8 * NAMESPACE_LIFETIME_MULTIPLIER): testlib.next_block( **kw ) - # verify that operations continue to fail + # verify that operations continue to fail (BUG in 0.13: THIS SUCCEEDS WHEN IT SHOULD FAIL) resp = testlib.blockstack_name_update( "foo.test", "11" * 20, wallets[3].privkey, safety_checks=False ) if 'error' in resp: print json.dumps( resp, indent=4 ) @@ -122,6 +128,10 @@ def scenario( wallets, **kw ): print json.dumps( resp, indent=4 ) testlib.next_block( **kw ) + + # warn the serialization checker that this changes behavior from 0.13 + print "BLOCKSTACK_SERIALIZATION_CHANGE_BEHAVIOR" + sys.stdout.flush() def check( state_engine ): diff --git a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_revoke_reregister_newowner.py b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_revoke_reregister_newowner.py index 2b78db9cb..b83ec0a25 100644 --- a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_revoke_reregister_newowner.py +++ b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_revoke_reregister_newowner.py @@ -25,7 +25,13 @@ import testlib import pybitcoin import json import blockstack as blockstack_server +import sys +# in epoch 2 immediately, but with the old price (in order to test compatibility with 0.13) +""" +TEST ENV BLOCKSTACK_EPOCH_1_END_BLOCK 250 +TEST ENV BLOCKSTACK_EPOCH_2_PRICE_MULTIPLIER 1.0 +""" wallets = [ testlib.Wallet( "5JesPiN68qt44Hc2nT8qmyZ1JDwHebfoh9KQ52Lazb1m1LaKNj9", 100000000000 ), testlib.Wallet( "5KHqsiU9qa77frZb6hQy9ocV7Sus9RWJcQGYYBJJBb2Efj1o77e", 100000000000 ), @@ -90,7 +96,7 @@ def scenario( wallets, **kw ): for i in xrange(0, 8 * NAMESPACE_LIFETIME_MULTIPLIER): testlib.next_block( **kw ) - # verify that operations continue to fail + # verify that operations continue to fail (BUG IN 0.13: THIS SUCCEEDS WHEN IT SHOULD FAIL) resp = testlib.blockstack_name_update( "foo.test", "11" * 20, wallets[3].privkey, safety_checks=False ) if 'error' in resp: print json.dumps( resp, indent=4 ) @@ -127,6 +133,10 @@ def scenario( wallets, **kw ): print json.dumps( resp, indent=4 ) testlib.next_block( **kw ) + + # warn the serialization checker that this changes behavior from 0.13 + print "BLOCKSTACK_SERIALIZATION_CHANGE_BEHAVIOR" + sys.stdout.flush() def check( state_engine ): diff --git a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_transfer_update_expire_reregister_delays.py b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_transfer_update_expire_reregister_delays.py index 327653f59..fb824ffa4 100644 --- a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_transfer_update_expire_reregister_delays.py +++ b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_transfer_update_expire_reregister_delays.py @@ -26,6 +26,11 @@ import pybitcoin import json import blockstack as blockstack_server +# in epoch 2 immediately, but with the old price (in order to test compatibility with 0.13) +""" +TEST ENV BLOCKSTACK_EPOCH_1_END_BLOCK 250 +TEST ENV BLOCKSTACK_EPOCH_2_PRICE_MULTIPLIER 1.0 +""" wallets = [ testlib.Wallet( "5JesPiN68qt44Hc2nT8qmyZ1JDwHebfoh9KQ52Lazb1m1LaKNj9", 100000000000 ), testlib.Wallet( "5KHqsiU9qa77frZb6hQy9ocV7Sus9RWJcQGYYBJJBb2Efj1o77e", 100000000000 ), diff --git a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_transfer_update_expire_reregister_delays_failure.py b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_transfer_update_expire_reregister_delays_failure.py index 26b3605fb..90cbd7813 100644 --- a/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_transfer_update_expire_reregister_delays_failure.py +++ b/integration_tests/blockstack_integration_tests/scenarios/name_preorder_register_transfer_update_expire_reregister_delays_failure.py @@ -26,6 +26,12 @@ import pybitcoin import json import blockstack as blockstack_server +# in epoch 2 immediately, but with the old price (in order to test compatibility with 0.13) +""" +TEST ENV BLOCKSTACK_EPOCH_1_END_BLOCK 250 +TEST ENV BLOCKSTACK_EPOCH_2_PRICE_MULTIPLIER 1.0 +""" + wallets = [ testlib.Wallet( "5JesPiN68qt44Hc2nT8qmyZ1JDwHebfoh9KQ52Lazb1m1LaKNj9", 100000000000 ), testlib.Wallet( "5KHqsiU9qa77frZb6hQy9ocV7Sus9RWJcQGYYBJJBb2Efj1o77e", 100000000000 ),