当前位置: 首页>>代码示例>>Python>>正文


Python testlib.next_block函数代码示例

本文整理汇总了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)
开发者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


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