mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-06-02 14:18:32 +08:00
set the appropriate epoch envars and use the new epoch config API, now
that the test framework defaults to epoch 1
This commit is contained in:
@@ -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" )
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ),
|
||||
|
||||
@@ -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 )
|
||||
|
||||
|
||||
@@ -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 ):
|
||||
|
||||
|
||||
@@ -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 ):
|
||||
|
||||
@@ -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 ):
|
||||
|
||||
@@ -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 ),
|
||||
|
||||
@@ -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 ),
|
||||
|
||||
Reference in New Issue
Block a user