本文整理汇总了Python中testlib.next_block函数的典型用法代码示例。如果您正苦于以下问题:Python next_block函数的具体用法?Python next_block怎么用?Python next_block使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了next_block函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: 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 )
# will all be rejected trivially, since the first import must come from the importer's address
testlib.blockstack_name_import( "foo.test", wallets[4].addr, "11" * 20, wallets[2].privkey )
testlib.blockstack_name_import( "bar.test", wallets[2].addr, "22" * 20, wallets[3].privkey )
testlib.blockstack_name_import( "baz.test", wallets[3].addr, "33" * 20, wallets[4].privkey )
testlib.next_block( **kw )
# will be accepted
testlib.blockstack_name_import( "goo.test", wallets[2].addr, "11" * 20, wallets[1].privkey )
# will all be rejected because they weren't sent from a importer-derived key
testlib.blockstack_name_import( "foo.test", wallets[4].addr, "11" * 20, wallets[2].privkey )
testlib.blockstack_name_import( "bar.test", wallets[2].addr, "22" * 20, wallets[3].privkey )
testlib.blockstack_name_import( "baz.test", wallets[3].addr, "33" * 20, wallets[4].privkey )
testlib.next_block( **kw )
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
开发者ID:ChairmanTubeAmp,项目名称:blockstack-server,代码行数:25,代码来源:namespace_preorder_reveal_import_onlyimporter.py
示例2: 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)
示例3: scenario
def scenario( wallets, **kw ):
testlib.blockstore_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstore_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 )
示例4: scenario
def scenario( wallets, **kw ):
resp = testlib.blockstack_cli_namespace_preorder("test", wallets[0].privkey, wallets[1].privkey)
if 'error' in resp:
print json.dumps(resp, indent=4, sort_keys=True)
return False
testlib.next_block(**kw)
示例5: scenario
def scenario( wallets, **kw ):
# order 3 namespaces
testlib.blockstore_namespace_preorder( "test1", wallets[1].addr, wallets[0].privkey )
testlib.blockstore_namespace_preorder( "test2", wallets[3].addr, wallets[2].privkey )
testlib.blockstore_namespace_preorder( "test3", wallets[5].addr, wallets[4].privkey )
testlib.next_block( **kw )
# reveal them all
testlib.blockstore_namespace_reveal( "test1", wallets[1].addr, 52595, 250, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 11, wallets[0].privkey )
testlib.blockstore_namespace_reveal( "test2", wallets[3].addr, 52596, 251, 5, [7,6,5,4,3,2,1,1,1,1,1,1,1,1,1,1], 11, 12, wallets[2].privkey )
testlib.blockstore_namespace_reveal( "test3", wallets[5].addr, 52597, 252, 6, [8,7,6,5,4,3,2,2,2,2,2,2,2,2,2,2], 12, 13, wallets[4].privkey )
testlib.next_block( **kw )
示例6: scenario
def scenario( wallets, **kw ):
global reveal_block
global preorder_block
testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
preorder_block = testlib.get_current_block( **kw ) + 1
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 )
reveal_block = testlib.get_current_block( **kw ) + 1
testlib.next_block( **kw )
示例7: scenario
def scenario(wallets, **kw):
testlib.blockstore_namespace_preorder("test", wallets[1].addr, wallets[0].privkey)
testlib.next_block(**kw)
testlib.blockstore_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.blockstore_namespace_ready("test", wallets[1].privkey)
testlib.next_block(**kw)
resp = testlib.blockstore_name_preorder_multi(
["foo.test", "bar.test", "baz.test"], wallets[2].privkey, [wallets[3].addr, wallets[4].addr, wallets[5].addr]
)
if "error" in resp:
print json.dumps(resp, indent=4)
testlib.next_block(**kw)
示例8: scenario
def scenario( wallets, **kw ):
global reveal_blocks, reveal_block
for count in xrange(0, 3):
resp = testlib.blockstack_namespace_preorder( "test", wallets[count+1].addr, wallets[count].privkey )
if 'error' in resp:
print json.dumps(resp, indent=4)
testlib.next_block( **kw )
# reveal it
buckets = [count] * 16
testlib.blockstack_namespace_reveal( "test", wallets[count+1].addr, count + 1, count + 1, count + 1, buckets, count + 1, count + 1, wallets[count].privkey )
testlib.next_block( **kw )
reveal_blocks.append( testlib.get_current_block(**kw) )
# expire it (2 blocks later)
for i in xrange(0, 3):
testlib.next_block( **kw )
# try to ready it (should fail)
resp = testlib.blockstack_namespace_ready( "test", wallets[count+1].privkey )
if 'error' in resp:
print json.dumps(resp, indent=4)
testlib.next_block( **kw )
开发者ID:blockstack,项目名称:blockstack-integration-tests,代码行数:28,代码来源:namespace_preorder_reveal_expire_multi.py
示例9: scenario
def scenario( wallets, **kw ):
resp = testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
if 'error' in resp:
print json.dumps(resp, indent=4)
# make the test abort at the next block
wd = testlib.get_working_dir( **kw )
os.chmod( wd, 0555 )
resp = testlib.blockstack_namespace_preorder( "test2", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
if 'error' in resp:
print json.dumps(resp, indent=4)
示例10: scenario
def scenario( wallets, **kw ):
global preorder_block, reveal_block
resp = testlib.blockstack_cli_namespace_preorder("test", wallets[0].privkey, wallets[1].privkey)
if 'error' in resp:
print json.dumps(resp, indent=4, sort_keys=True)
return False
preorder_block = testlib.get_current_block( **kw ) + 1
testlib.next_block(**kw)
resp = testlib.blockstack_cli_namespace_reveal('test', wallets[0].privkey, wallets[1].privkey, 52595, 250, 4, '6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0', 10, 10)
if 'error' in resp:
print json.dumps(resp, indent=4, sort_keys=True)
return False
reveal_block = testlib.get_current_block( **kw ) + 1
testlib.next_block(**kw)
示例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 )
# only wallets[3] should get it
testlib.blockstack_name_register( "foo.test", wallets[4].privkey, wallets[3].addr, safety_checks=False )
testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr, safety_checks=False )
testlib.next_block( **kw )
示例12: scenario
def scenario( wallets, **kw ):
global snv_consensus, snv_block_id
testlib.blockstore_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstore_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.blockstore_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
testlib.blockstore_name_preorder( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstore_name_register( "foo.test", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
snv_block_id = testlib.get_current_block()
snv_consensus = testlib.get_consensus_at( snv_block_id )
示例13: scenario
def scenario(wallets, **kw):
testlib.blockstore_namespace_preorder("test", wallets[1].addr, wallets[0].privkey)
# wait 10 blocks between
for i in xrange(0, 10):
testlib.next_block(**kw)
testlib.blockstore_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,
)
# wait 10 blocks between
for i in xrange(0, 10):
testlib.next_block(**kw)
testlib.blockstore_namespace_ready("test", wallets[1].privkey)
# wait 10 blocks between
for i in xrange(0, 10):
testlib.next_block(**kw)
示例14: scenario
def scenario( wallets, **kw ):
testlib.blockstore_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstore_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.blockstore_name_import( "foo.test", wallets[2].addr, "11" * 20, wallets[1].privkey )
testlib.blockstore_name_import( "bar.test", wallets[3].addr, "22" * 20, wallets[1].privkey )
testlib.blockstore_name_import( "baz.test", wallets[4].addr, "33" * 20, wallets[1].privkey )
testlib.next_block( **kw )
testlib.blockstore_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
示例15: scenario
def scenario( wallets, **kw ):
global final_consensus
testlib.blockstore_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstore_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.blockstore_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
resp = testlib.blockstore_name_preorder_multi( ["foo.test", "bar.test", "baz.test"], wallets[2].privkey, [wallets[3].addr, wallets[4].addr, wallets[5].addr] )
if 'error' in resp:
print json.dumps( resp, indent=4 )
sys.exit(1)
testlib.next_block( **kw )
preorder_consensus = testlib.get_consensus_at( testlib.get_current_block() )
# these should all fail, since they're paired with the wrong addresses
resp = testlib.blockstore_name_register( "foo.test", wallets[2].privkey, wallets[5].addr )
if 'error' in resp:
print json.dumps( resp, indent=4 )
sys.exit(1)
resp = testlib.blockstore_name_register( "bar.test", wallets[2].privkey, wallets[3].addr )
if 'error' in resp:
print json.dumps( resp, indent=4 )
sys.exit(1)
resp = testlib.blockstore_name_register( "baz.test", wallets[2].privkey, wallets[4].addr )
if 'error' in resp:
print json.dumps( resp, indent=4 )
sys.exit(1)
testlib.next_block( **kw )