本文整理汇总了Python中testlib.blockstack_name_preorder函数的典型用法代码示例。如果您正苦于以下问题:Python blockstack_name_preorder函数的具体用法?Python blockstack_name_preorder怎么用?Python blockstack_name_preorder使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了blockstack_name_preorder函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: scenario
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 )
# NOTE: names expire in 5 * NAMESPACE_LIFETIME_MULTIPLER blocks
testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 5, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
testlib.blockstack_name_preorder( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
first_preorder = testlib.get_current_block( **kw )
testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
for i in xrange(0, 5 * blockstack_server.config.get_epoch_namespace_lifetime_multiplier( testlib.get_current_block(**kw), "test" )):
testlib.next_block( **kw )
testlib.next_block( **kw )
testlib.blockstack_name_preorder( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
last_first_block = testlib.get_current_block( **kw )
开发者ID:blockstack,项目名称:blockstack-integration-tests,代码行数:33,代码来源:name_preorder_register_expire_reregister.py
示例2: scenario
def scenario( wallets, **kw ):
global working_dir
testlib.blockstack_namespace_preorder( "id", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_reveal( "id", wallets[1].addr, 52595, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "id", wallets[1].privkey )
testlib.next_block( **kw )
testlib.blockstack_name_preorder( "judecn.id", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstack_name_register( "judecn.id", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
resp = testlib.blockstack_announce( "hello world!", wallets[3].privkey )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
resp = testlib.blockstack_announce( "This should not appear", wallets[4].privkey )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
# save...
working_dir = testlib.get_working_dir( **kw )
开发者ID:blockstack,项目名称:blockstack-integration-tests,代码行数:32,代码来源:name_preorder_register_announce.py
示例3: scenario
def scenario( wallets, **kw ):
global txids
global consensuses
testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 52595, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
testlib.blockstack_name_preorder( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.next_block( **kw )
# do a sequence of updates, every other block
for i in xrange( 0, 20 ):
if (i % 2) != 0:
update_hash = ("%02x" % (i)) * 20
resp = testlib.blockstack_name_update( "foo.test", update_hash, wallets[3].privkey )
txids[ update_hash ] = resp['transaction_hash']
consensuses[ update_hash ] = testlib.get_consensus_at( testlib.get_current_block( **kw ), **kw )
testlib.next_block( **kw )
testlib.next_block( **kw )
开发者ID:ChairmanTubeAmp,项目名称:blockstack-server,代码行数:34,代码来源:name_preorder_register_update_history.py
示例4: scenario
def scenario( wallets, **kw ):
global put_result, wallet_keys, datasets, zonefile_hash, dataset_change
testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 52595, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
testlib.blockstack_name_preorder( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
test_proxy = testlib.TestAPIProxy()
blockstack_client.set_default_proxy( test_proxy )
wallet_keys = blockstack_client.make_wallet_keys( owner_privkey=wallets[3].privkey )
# migrate profile
res = testlib.migrate_profile( "foo.test", proxy=test_proxy, wallet_keys=wallet_keys )
if 'error' in res:
res['test'] = 'Failed to initialize foo.test profile'
print json.dumps(res, indent=4, sort_keys=True)
error = True
return
else:
zonefile_hash = res['zonefile_hash']
testlib.next_block( **kw )
put_result = blockstack_client.put_mutable( "foo.test", "hello_world_1", datasets[0], proxy=test_proxy, wallet_keys=wallet_keys )
if 'error' in put_result:
print json.dumps(put_result, indent=4, sort_keys=True)
testlib.next_block( **kw )
put_result = blockstack_client.put_mutable( "foo.test", "hello_world_2", datasets[1], proxy=test_proxy, wallet_keys=wallet_keys )
if 'error' in put_result:
print json.dumps(put_result, indent=4, sort_keys=True)
put_result = blockstack_client.put_mutable( "foo.test", "hello_world_3", datasets[2], proxy=test_proxy, wallet_keys=wallet_keys )
if 'error' in put_result:
print json.dumps(put_result, indent=4, sort_keys=True)
# increment version too
datasets[0]['buf'] = []
for i in xrange(0, 5):
datasets[0]["dataset_change"] = dataset_change
datasets[0]['buf'].append(i)
put_result = blockstack_client.put_mutable( "foo.test", "hello_world_1", datasets[0], proxy=test_proxy, wallet_keys=wallet_keys )
if 'error' in put_result:
print json.dumps(put_result, indent=4, sort_keys=True )
testlib.next_block( **kw )
开发者ID:odinho,项目名称:blockstack-integration-tests,代码行数:60,代码来源:name_preorder_register_update_putmutable_nodatakey.py
示例5: scenario
def scenario( wallets, **kw ):
testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 52595, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
testlib.blockstack_name_preorder( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
# wait for a bit...
for i in xrange(0, 10):
testlib.next_block( **kw )
resp = testlib.blockstack_name_renew( "foo.test", wallets[3].privkey )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
global snv_consensus, snv_block_id
snv_block_id = testlib.get_current_block()
snv_consensus = testlib.get_consensus_at( snv_block_id )
testlib.next_block( **kw )
开发者ID:ChairmanTubeAmp,项目名称:blockstack-server,代码行数:32,代码来源:name_preorder_register_renew_snv.py
示例6: scenario
def scenario( wallets, **kw ):
global snv_block_id, last_consensus
testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
# NOTE: names expire in 13 blocks
testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 13, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
testlib.blockstack_name_preorder( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
snv_block_id = testlib.get_current_block()
for i in xrange(0, 15):
testlib.next_block( **kw )
last_consensus = testlib.get_consensus_at( testlib.get_current_block() )
开发者ID:odinho,项目名称:blockstack-integration-tests,代码行数:26,代码来源:name_preorder_register_expire_snv.py
示例7: scenario
def scenario( wallets, **kw ):
testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 52595, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
testlib.blockstack_name_preorder( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
# wait for a bit...
for i in xrange(0, 10):
testlib.next_block( **kw )
# has to be the same key that registered...
resp = testlib.blockstack_name_renew( "foo.test", wallets[4].privkey )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
testlib.next_block( **kw )
开发者ID:ChairmanTubeAmp,项目名称:blockstack-server,代码行数:28,代码来源:name_preorder_register_renew_cantforce.py
示例8: scenario
def scenario( wallets, **kw ):
testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 52595, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
testlib.blockstack_name_preorder( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstack_name_update( "foo.test", "11" * 20, wallets[3].privkey )
testlib.next_block( **kw )
consensus_hash = testlib.get_consensus_at( testlib.get_current_block( **kw ), **kw )
# lots of blocks later...
for i in xrange(0, 50):
testlib.next_block( **kw )
# update with stale consensus hash (should fail)
print "\n\nsend update with consensus hash %s\n\n" % consensus_hash
testlib.blockstack_name_update( "foo.test", "22" * 20, wallets[3].privkey, consensus_hash=consensus_hash )
testlib.next_block( **kw )
开发者ID:blockstack,项目名称:blockstack-integration-tests,代码行数:30,代码来源:name_preorder_register_update_notstale.py
示例9: scenario
def scenario( wallets, **kw ):
testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 52595, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
resp = testlib.blockstack_name_preorder( "foo.test", wallets[2].privkey, wallets[3].addr )
if 'error' in resp:
print json.dumps( resp )
testlib.next_block( **kw )
# wait for it to expire (takes a day)
for i in xrange(0, 145):
testlib.next_block( **kw )
# re-preorder it
resp = testlib.blockstack_name_preorder( "foo.test", wallets[3].privkey, wallets[4].addr )
if 'error' in resp:
print json.dumps( resp )
testlib.next_block( **kw )
# register it
resp = testlib.blockstack_name_register( "foo.test", wallets[3].privkey, wallets[4].addr )
if 'error' in resp:
print json.dumps( resp )
testlib.next_block( **kw )
开发者ID:ChairmanTubeAmp,项目名称:blockstack-server,代码行数:34,代码来源:name_preorder_expire.py
示例10: scenario
def scenario(wallets, **kw):
testlib.blockstack_namespace_preorder("test", wallets[1].addr, wallets[0].privkey)
testlib.next_block(**kw)
testlib.blockstack_namespace_reveal(
"test",
wallets[1].addr,
52595,
250,
4,
[6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
10,
10,
wallets[0].privkey,
)
testlib.next_block(**kw)
testlib.blockstack_namespace_ready("test", wallets[1].privkey)
testlib.next_block(**kw)
testlib.blockstack_name_preorder("foo.test", wallets[2].privkey, wallets[3].addr)
testlib.next_block(**kw)
testlib.blockstack_name_register("foo.test", wallets[2].privkey, wallets[3].addr)
testlib.next_block(**kw)
开发者ID:ChairmanTubeAmp,项目名称:blockstack-server,代码行数:26,代码来源:name_preorder_register.py
示例11: scenario
def scenario( wallets, **kw ):
testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 52595, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
testlib.blockstack_name_preorder( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstack_name_update( "foo.test", "11" * 20, wallets[3].privkey )
testlib.next_block( **kw )
# should fail--can't give a name to yourself
testlib.blockstack_name_transfer( "foo.test", wallets[4].addr, True, wallets[4].privkey )
testlib.next_block( **kw )
# should fail--can't steal a name
testlib.blockstack_name_transfer( "foo.test", wallets[4].addr, True, wallets[0].privkey )
testlib.next_block( **kw )
开发者ID:ChairmanTubeAmp,项目名称:blockstack-server,代码行数:27,代码来源:name_preorder_register_update_transfer_cantsteal.py
示例12: scenario
def scenario( wallets, **kw ):
testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 52595, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
testlib.blockstack_name_preorder( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
# update and transfer back and forth a few times
for i in xrange(0, 5):
result = testlib.blockstack_name_update( "foo.test", str(i) * 40, wallets[3 + (i%2)].privkey )
update_hashes.append( str(i) * 40 )
testlib.next_block( **kw )
result = testlib.blockstack_name_transfer( "foo.test", wallets[3 + ((i+1)%2)].addr, True, wallets[3 + (i%2)].privkey )
testlib.next_block( **kw )
开发者ID:blockstack,项目名称:blockstack-integration-tests,代码行数:26,代码来源:name_preorder_register_update_listhistory.py
示例13: scenario
def scenario( wallets, **kw ):
global snv_block_id, last_consensus
testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 52595, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
testlib.blockstack_name_preorder( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
snv_block_id = testlib.get_current_block()
resp = testlib.blockstack_name_revoke( "foo.test", wallets[3].privkey )
testlib.next_block( **kw )
last_consensus = testlib.get_consensus_at( testlib.get_current_block() )
开发者ID:blockstack,项目名称:blockstack-integration-tests,代码行数:25,代码来源:name_preorder_register_revoke_snv.py
示例14: scenario
def scenario( wallets, **kw ):
global register_block, revoke_block
# make a test namespace
resp = testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
if debug or 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
resp = testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 6, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
if debug or 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
resp = testlib.blockstack_name_import( "foo.test", wallets[3].addr, "11" * 20, wallets[1].privkey )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
resp = testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
if debug or 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
# wait for a bit...
for i in xrange(0, 6):
testlib.next_block( **kw )
resp = testlib.blockstack_name_renew( "foo.test", wallets[3].privkey )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
# revoke it
resp = testlib.blockstack_name_revoke( "foo.test", wallets[3].privkey )
if 'error' in resp:
print json.dumps(resp, indent=4 )
testlib.next_block( **kw )
revoke_block = testlib.get_current_block( **kw )
# wait for it to expire
for i in xrange(0, 6 * NAMESPACE_LIFETIME_MULTIPLIER):
testlib.next_block( **kw )
# re-register
testlib.blockstack_name_preorder( "foo.test", wallets[7].privkey, wallets[8].addr )
testlib.next_block( **kw )
testlib.blockstack_name_register( "foo.test", wallets[7].privkey, wallets[8].addr )
testlib.next_block( **kw )
register_block = testlib.get_current_block( **kw )
开发者ID:blockstack,项目名称:blockstack-integration-tests,代码行数:60,代码来源:name_import_revoke_expire_reregister.py
示例15: scenario
def scenario( wallets, **kw ):
global wallet_keys, wallet_keys_2, key_names, error
testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 52595, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
testlib.blockstack_name_preorder( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
test_proxy = testlib.TestAPIProxy()
blockstack_client.set_default_proxy( test_proxy )
wallet_keys = blockstack_client.make_wallet_keys( owner_privkey=wallets[3].privkey, data_privkey=wallets[4].privkey )
# migrate profiles
res = testlib.migrate_profile( "foo.test", proxy=test_proxy, wallet_keys=wallet_keys )
if 'error' in res:
res['test'] = 'Failed to initialize foo.test profile'
print json.dumps(res, indent=4, sort_keys=True)
error = True
return
testlib.next_block( **kw )
# make an account
res = blockstack_client.put_account("foo.test", "serviceFoo", "serviceFooID", "foo://bar.com", proxy=test_proxy, wallet_keys=wallet_keys, foofield="foo!" )
if 'error' in res:
res['test'] = 'Failed to create foo.test account'
print json.dumps(res, indent=4, sort_keys=True)
error = True
return
res = blockstack_client.put_account("foo.test", "deletedService", "deletedServiceID", "foo://deleted", proxy=test_proxy, wallet_keys=wallet_keys, barfield="bar!")
if 'error' in res:
res['test'] = 'Failed to create foo.test deletedService account'
print json.dumps(res, indent=4, sort_keys=True)
error = True
return
# delete an account
res = blockstack_client.delete_account("foo.test", "deletedService", "deletedServiceID", proxy=test_proxy, wallet_keys=wallet_keys )
if 'error' in res:
res['test'] = 'Failed to delete foo.test deletedService'
print json.dumps(res, indent=4, sort_keys=True)
error = True
return
testlib.next_block( **kw )
开发者ID:odinho,项目名称:blockstack-integration-tests,代码行数:58,代码来源:name_preorder_register_update_accounts.py
示例16: scenario
def scenario( wallets, **kw ):
global fail_blocks
testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 2, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
testlib.blockstack_name_preorder( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
# wait for it to expire...
for i in xrange(0, 2 * NAMESPACE_LIFETIME_MULTIPLIER + 1):
testlib.next_block( **kw )
# verify that operations 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 )
testlib.next_block( **kw )
fail_blocks.append( testlib.get_current_block( **kw ) )
testlib.expect_snv_fail_at( "foo.test", testlib.get_current_block(**kw))
# should fail
resp = testlib.blockstack_name_transfer( "foo.test", wallets[4].addr, True, wallets[3].privkey, safety_checks=False )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
fail_blocks.append( testlib.get_current_block( **kw ) )
testlib.expect_snv_fail_at( "foo.test", testlib.get_current_block(**kw))
# should fail
resp = testlib.blockstack_name_renew( "foo.test", wallets[3].privkey, safety_checks=False )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
fail_blocks.append( testlib.get_current_block( **kw ) )
testlib.expect_snv_fail_at( "foo.test", testlib.get_current_block(**kw))
# should fail
resp = testlib.blockstack_name_revoke( "foo.test", wallets[3].privkey, safety_checks=False )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
fail_blocks.append( testlib.get_current_block( **kw ))
testlib.expect_snv_fail_at( "foo.test", testlib.get_current_block(**kw))
开发者ID:blockstack,项目名称:blockstack-integration-tests,代码行数:58,代码来源:name_preorder_register_expire_isdead.py
示例17: scenario
def scenario( wallets, **kw ):
global import_block_1, import_block_2
# make a test namespace
resp = testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
if debug or 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
resp = testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 10, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
if debug or 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
resp = testlib.blockstack_name_import( "foo.test", wallets[3].addr, "11" * 20, wallets[1].privkey )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
import_block_1 = testlib.get_current_block( **kw )
testlib.next_block( **kw )
resp = testlib.blockstack_name_import( "foo.test", wallets[4].addr, "22" * 20, wallets[1].privkey )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
import_block_2 = testlib.get_current_block( **kw )
testlib.next_block( **kw )
resp = testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
if debug or 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
# wait for expiration (with multipler)...
for i in xrange(0, 10 * NAMESPACE_LIFETIME_MULTIPLIER):
testlib.next_block( **kw )
# re-register
testlib.blockstack_name_preorder( "foo.test", wallets[7].privkey, wallets[8].addr )
testlib.next_block( **kw )
testlib.blockstack_name_register( "foo.test", wallets[7].privkey, wallets[8].addr )
testlib.next_block( **kw )
开发者ID:blockstack,项目名称:blockstack-integration-tests,代码行数:53,代码来源:name_import_import_expire_reregister.py
示例18: scenario
def scenario( wallets, **kw ):
global snv_block_id_foo, snv_serial_number_bar, snv_serial_number_baz, last_consensus, snv_txid_bar, snv_txid_baz
testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 52595, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
testlib.blockstack_name_preorder( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
snv_block_id_foo = testlib.get_current_block()
testlib.next_block( **kw )
testlib.next_block( **kw )
testlib.next_block( **kw )
testlib.next_block( **kw )
testlib.next_block( **kw )
bar_preorder = testlib.blockstack_name_preorder( "bar.test", wallets[4].privkey, wallets[5].addr )
testlib.next_block( **kw )
snv_serial_number_bar = "%s-%s" % (testlib.get_current_block(), 0 )
snv_txid_bar = bar_preorder['transaction_hash']
testlib.blockstack_name_register( "bar.test", wallets[4].privkey, wallets[5].addr )
testlib.next_block( **kw )
testlib.next_block( **kw )
testlib.next_block( **kw )
testlib.next_block( **kw )
testlib.next_block( **kw )
testlib.next_block( **kw )
baz_preorder = testlib.blockstack_name_preorder( "baz.test", wallets[6].privkey, wallets[7].addr )
testlib.next_block( **kw )
snv_serial_number_baz = "%s-%s" % (testlib.get_current_block(), 0 )
snv_txid_baz = baz_preorder['transaction_hash']
testlib.blockstack_name_register( "baz.test", wallets[6].privkey, wallets[7].addr )
testlib.next_block( **kw )
last_consensus = testlib.get_consensus_at( testlib.get_current_block() )
开发者ID:odinho,项目名称:blockstack-integration-tests,代码行数:52,代码来源:name_preorder_register_multi_snv.py
示例19: scenario
def scenario( wallets, **kw ):
testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 1, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
# preorder, register, expire (multiple times)
for i in xrange(2, 5):
resp = testlib.blockstack_name_preorder( "foo.test", wallets[2].privkey, wallets[3].addr )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
resp = testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
if i == 4:
break
testlib.next_block( **kw )
testlib.next_block( **kw )
开发者ID:ChairmanTubeAmp,项目名称:blockstack-server,代码行数:30,代码来源:name_preorder_register_reregister_sameowner.py
示例20: scenario
def scenario( wallets, **kw ):
testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 10, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
consensus_hash = testlib.get_consensus_at( testlib.get_current_block(**kw), **kw)
testlib.next_block( **kw )
testlib.next_block( **kw )
# preorder, register, update, expire (multiple times)
for i in xrange(2, 11):
resp = testlib.blockstack_name_preorder( "foo.test", wallets[i].privkey, wallets[(i+1)%11].addr, consensus_hash=consensus_hash )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
consensus_hash = testlib.get_consensus_at( testlib.get_current_block(**kw), **kw)
testlib.next_block( **kw )
testlib.next_block( **kw )
resp = testlib.blockstack_name_register( "foo.test", wallets[i].privkey, wallets[(i+1)%11].addr )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
consensus_hash = testlib.get_consensus_at( testlib.get_current_block(**kw), **kw)
testlib.next_block( **kw )
testlib.next_block( **kw )
resp = testlib.blockstack_name_transfer( "foo.test", wallets[i].addr, True, wallets[(i+1)%11].privkey, consensus_hash=consensus_hash )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
consensus_hash = testlib.get_consensus_at( testlib.get_current_block(**kw), **kw)
testlib.next_block( **kw )
testlib.next_block( **kw )
resp = testlib.blockstack_name_update( "foo.test", ("%02x" % i) * 20, wallets[i].privkey, consensus_hash=consensus_hash )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
consensus_hash = testlib.get_consensus_at( testlib.get_current_block(**kw), **kw)
testlib.next_block( **kw )
testlib.next_block( **kw )
if i == 10:
break
testlib.next_block( **kw )
consensus_hash = testlib.get_consensus_at( testlib.get_current_block(**kw), **kw)
testlib.next_block( **kw )
testlib.next_block( **kw )
开发者ID:odinho,项目名称:blockstack-integration-tests,代码行数:59,代码来源:name_preorder_register_transfer_update_expire_reregister_delays.py
注:本文中的testlib.blockstack_name_preorder函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论