• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python testlib.next_block函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中testlib.next_block函数的典型用法代码示例。如果您正苦于以下问题:Python next_block函数的具体用法?Python next_block怎么用?Python next_block使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了next_block函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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)
开发者ID:ChairmanTubeAmp,项目名称:blockstack-server,代码行数:26,代码来源:name_preorder_register.py


示例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 )
开发者ID:reddink,项目名称:blockstore,代码行数:7,代码来源:namespace_preorder_reveal.py


示例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)
开发者ID:destenson,项目名称:blockstack--blockstack-server,代码行数:7,代码来源:rpc_namespace_preorder.py


示例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 )
开发者ID:reddink,项目名称:blockstore,代码行数:13,代码来源:namespace_preorder_reveal_multi.py


示例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 )
开发者ID:blockstack,项目名称:blockstack-integration-tests,代码行数:13,代码来源:namespace_preorder_reveal.py


示例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)
开发者ID:pombredanne,项目名称:blockstore,代码行数:28,代码来源:name_preorder_multi.py


示例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)
开发者ID:blockstack,项目名称:blockstack-integration-tests,代码行数:16,代码来源:virtualchain_abort.py


示例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)
开发者ID:destenson,项目名称:blockstack--blockstack-server,代码行数:18,代码来源:rpc_namespace_preorder_reveal.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 )
   
    # 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 )
开发者ID:blockstack,项目名称:blockstack-integration-tests,代码行数:18,代码来源:name_preorder_register_cantsteal.py


示例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 )
开发者ID:reddink,项目名称:blockstore,代码行数:21,代码来源:name_preorder_register_snv.py


示例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)
开发者ID:reddink,项目名称:blockstore,代码行数:29,代码来源:namespace_preorder_reveal_ready_wait.py


示例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 )
开发者ID:reddink,项目名称:blockstore,代码行数:15,代码来源:namespace_preorder_reveal_import_ready.py


示例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 )
开发者ID:pombredanne,项目名称:blockstore,代码行数:38,代码来源:name_preorder_multi_register_nochangeaddress.py


示例16: 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, safety_checks=False )
    testlib.blockstack_name_preorder( "foo.test", wallets[4].privkey, wallets[5].addr, safety_checks=False )
    testlib.blockstack_name_preorder( "foo.test", wallets[0].privkey, wallets[1].addr, safety_checks=False )
    testlib.blockstack_name_preorder( "foo.test", wallets[5].privkey, wallets[2].addr, safety_checks=False )
    testlib.next_block( **kw )

    # all of these should fail, since they're in the same block
    testlib.blockstack_name_register( "foo.test", wallets[2].privkey, wallets[3].addr, safety_checks=False )
    testlib.blockstack_name_register( "foo.test", wallets[4].privkey, wallets[5].addr, safety_checks=False )
    testlib.blockstack_name_register( "foo.test", wallets[0].privkey, wallets[1].addr, safety_checks=False )
    testlib.blockstack_name_register( "foo.test", wallets[5].privkey, wallets[2].addr, safety_checks=False )
    testlib.next_block( **kw )
开发者ID:blockstack,项目名称:blockstack-integration-tests,代码行数:23,代码来源:name_preorder_register_nodups.py


示例17: scenario

def scenario( wallets, **kw ): 
    resp = testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block( **kw )

    # reveal it  
    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 )

    # expire it (1 day later)
    for i in xrange(0, 145): 
        testlib.next_block( **kw )

    # try to ready it (should fail)
    resp = testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block( **kw )

    testlib.next_block( **kw )
开发者ID:blockstack,项目名称:blockstack-integration-tests,代码行数:23,代码来源:namespace_preorder_reveal_expire.py


示例18: scenario

def scenario( wallets, **kw ):

    # save the wallet 
    wallet = testlib.blockstack_client_initialize_wallet( "0123456789abcdef", wallets[2].privkey, wallets[3].privkey, wallets[4].privkey, start_rpc=False )
    if 'error' in wallet:
        print 'failed to set wallet: {}'.format(wallet)
        return False

    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( "foo.id", wallets[2].privkey, wallets[3].addr )
    testlib.next_block( **kw )

    testlib.blockstack_name_register( "foo.id", wallets[2].privkey, wallets[3].addr )
    testlib.next_block( **kw )

    # start api server 
    res = testlib.start_api("0123456789abcdef")
    if 'error' in res:
        print 'failed to start API server: {}'.format(res)
        return False

    # set up node environment 
    nodedir = testlib.nodejs_setup()

    # run 'core-test' test on blockstack (tests authentication from blockstack.js to Core API)
    testlib.nodejs_copy_package(nodedir, "blockstack")
    testlib.nodejs_copy_package(nodedir, "blockstack-storage")
    testlib.nodejs_run_test(nodedir, "integration-test-storage")
    testlib.nodejs_cleanup(nodedir)
开发者ID:destenson,项目名称:blockstack--blockstack-server,代码行数:37,代码来源:name_preorder_register_portal_datastore.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, 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 )

    # can't import once ready
    resp = testlib.blockstack_name_import( "foo.test", wallets[1].addr, "11" * 20, wallets[0].privkey )
    if 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )
开发者ID:ChairmanTubeAmp,项目名称:blockstack-server,代码行数:17,代码来源:namespace_preorder_reveal_ready_noimports.py


示例20: scenario

def scenario( wallets, **kw ): 
    resp = testlib.blockstack_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block( **kw )

    # expire it (1 day later)
    for i in xrange(0, 145): 
        testlib.next_block( **kw )

    # try to re-preorder it 
    resp = testlib.blockstack_namespace_preorder( "test", wallets[3].addr, wallets[2].privkey )
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block( **kw )
开发者ID:blockstack,项目名称:blockstack-integration-tests,代码行数:17,代码来源:namespace_preorder_expire.py



注:本文中的testlib.next_block函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python testlib.random_string函数代码示例发布时间:2022-05-27
下一篇:
Python testlib.new_graph函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap