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 )

    resp = testlib.blockstore_name_import( "foo.test", wallets[2].addr, "11" * 20, wallets[1].privkey )
    if 'error' in resp:
        print json.dumps(resp, indent=4 )

    testlib.next_block( **kw )

    resp = testlib.blockstore_name_import( "foo.test", wallets[3].addr, "22" * 20, wallets[1].privkey )
    if 'error' in resp:
        print json.dumps(resp, indent=4 )

    testlib.next_block( **kw )

    resp = testlib.blockstore_name_import( "foo.test", wallets[4].addr, "44" * 20, wallets[1].privkey )
    resp = testlib.blockstore_name_import( "foo.test", wallets[4].addr, "55" * 20, wallets[1].privkey )
    resp = testlib.blockstore_name_import( "foo.test", wallets[4].addr, "33" * 20, wallets[1].privkey )
    if 'error' in resp:
        print json.dumps(resp, indent=4 )

    testlib.next_block( **kw )
    
    testlib.blockstore_namespace_ready( "test", wallets[1].privkey )
    testlib.next_block( **kw )
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 )

    resp = testlib.blockstore_name_import( "foo.test", "1BKufFedDrueBBFBXtiATB2PSdsBGZxf3N", "11" * 20, wallets[1].privkey )    # master
    if 'error' in resp:
        print json.dumps(resp, indent=4 )

    testlib.next_block( **kw )

    resp = testlib.blockstore_name_import( "foo.test", "1ARVjrtKnUVWt2GNrpuFLnNCL2WGUhKdkW", "33" * 20, wallets[3].privkey )    # derived child 2
    if 'error' in resp:
        print json.dumps(resp, indent=4 )

    testlib.next_block( **kw )

    resp = testlib.blockstore_name_import( "foo.test", "1PYu4vKB3g2QLDFdurxqYSJ9aJSed7tne1", "22" * 20, wallets[2].privkey )    # derived child 1
    if 'error' in resp:
        print json.dumps(resp, indent=4 )

    testlib.next_block( **kw )

    
    testlib.blockstore_namespace_ready( "test", wallets[1].privkey )
    testlib.next_block( **kw )
def scenario( wallets, **kw ):

    global snv_block_id_foo, snv_txid_bar, snv_txid_baz, last_consensus 

    # make a test namespace
    resp = testlib.blockstore_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.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 )
    if debug or 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )

    resp = testlib.blockstore_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 )

    snv_block_id_foo = testlib.get_current_block()

    resp = testlib.blockstore_name_import( "bar.test", wallets[5].addr, "33" * 20, wallets[1].privkey )
    if 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )

    resp = testlib.blockstore_name_import( "baz.test", wallets[6].addr, "33" * 20, wallets[1].privkey )
    if 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )

    resp = testlib.blockstore_namespace_ready( "test", wallets[1].privkey )
    if debug or 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )

    resp = testlib.blockstore_name_transfer( "bar.test", wallets[4].addr, True, wallets[5].privkey )
    if 'error' in resp:
        print json.dumps( resp, indent=4 )

    snv_txid_bar = resp['transaction_hash']
    testlib.next_block( **kw )

    resp = testlib.blockstore_name_update( "baz.test", "22" * 20, wallets[6].privkey )
    if 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )
    last_consensus = testlib.get_consensus_at( testlib.get_current_block() )
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)

    resp = testlib.blockstore_name_import("foo.test",
                                          "1BKufFedDrueBBFBXtiATB2PSdsBGZxf3N",
                                          "11" * 20,
                                          wallets[1].privkey)  # master
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    resp = testlib.blockstore_name_import(
        "foo.test", "1ARVjrtKnUVWt2GNrpuFLnNCL2WGUhKdkW", "33" * 20,
        wallets[3].privkey)  # derived child 2
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    resp = testlib.blockstore_name_import(
        "foo.test", "1PYu4vKB3g2QLDFdurxqYSJ9aJSed7tne1", "22" * 20,
        wallets[2].privkey)  # derived child 1
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    testlib.blockstore_namespace_ready("test", wallets[1].privkey)
    testlib.next_block(**kw)
Example #5
0
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)

    resp = testlib.blockstore_name_import("foo.test", wallets[2].addr,
                                          "11" * 20, wallets[1].privkey)
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    resp = testlib.blockstore_name_import("foo.test", wallets[3].addr,
                                          "22" * 20, wallets[1].privkey)
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    resp = testlib.blockstore_name_import("foo.test", wallets[4].addr,
                                          "44" * 20, wallets[1].privkey)
    resp = testlib.blockstore_name_import("foo.test", wallets[4].addr,
                                          "55" * 20, wallets[1].privkey)
    resp = testlib.blockstore_name_import("foo.test", wallets[4].addr,
                                          "33" * 20, wallets[1].privkey)
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    testlib.blockstore_namespace_ready("test", wallets[1].privkey)
    testlib.next_block(**kw)
Example #6
0
def scenario(wallets, **kw):

    global last_consensus, snv_block_id

    # make a test namespace
    resp = testlib.blockstore_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.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)
    if debug or 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    resp = testlib.blockstore_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)

    snv_block_id = testlib.get_current_block()

    resp = testlib.blockstore_namespace_ready("test", wallets[1].privkey)
    if debug or 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    resp = testlib.blockstore_name_transfer("foo.test", wallets[4].addr, True,
                                            wallets[3].privkey)
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    resp = testlib.blockstore_name_update("foo.test", "22" * 20,
                                          wallets[4].privkey)
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)
    last_consensus = testlib.get_consensus_at(testlib.get_current_block())
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 )
def scenario( wallets, **kw ):

    # make a test namespace
    resp = testlib.blockstore_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.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 )
    if debug or 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )

    resp = testlib.blockstore_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.blockstore_namespace_ready( "test", wallets[1].privkey )
    if debug or 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )

    resp = testlib.blockstore_name_transfer( "foo.test", wallets[4].addr, True, wallets[3].privkey )
    if 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )

    resp = testlib.blockstore_name_update( "foo.test", "22" * 20, wallets[4].privkey )
    if 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )
Example #9
0
def scenario(wallets, **kw):

    # make a test namespace
    resp = testlib.blockstore_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.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)
    if debug or 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # import 3 names in the same block: foo.test, bar.test, baz.test
    names = ['foo.test', 'bar.test', 'baz.test']
    name_preorder_wallets = [wallets[2], wallets[3], wallets[4]]
    name_register_wallets = [wallets[5], wallets[6], wallets[7]]
    name_transfer_wallets = [wallets[6], wallets[7], wallets[5]]

    for i in xrange(0, len(names)):

        name = names[i]
        register_wallet = name_register_wallets[i]

        resp = testlib.blockstore_name_import(name, register_wallet.addr,
                                              str(9 - i) * 40,
                                              wallets[1].privkey)
        if debug or 'error' in resp:
            print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # namespace ready...
    resp = testlib.blockstore_namespace_ready("test", wallets[1].privkey)
    if debug or 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # update 3 names in the same block
    for i in xrange(0, len(names)):

        name = names[i]
        register_wallet = name_register_wallets[i]

        resp = testlib.blockstore_name_update(name,
                                              str(i + 1) * 40,
                                              register_wallet.privkey)
        if debug or 'error' in resp:
            print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # transfer 3 names in the same block
    for i in xrange(0, len(names)):

        name = names[i]
        register_wallet = name_register_wallets[i]
        transfer_wallet = name_transfer_wallets[i]

        resp = testlib.blockstore_name_transfer(name, transfer_wallet.addr,
                                                True, register_wallet.privkey)
        if debug or 'error' in resp:
            print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # exchange after transfer...
    tmp = name_register_wallets
    name_register_wallets = name_transfer_wallets
    name_transfer_wallets = tmp

    # revoke 3 names in the same block
    for i in xrange(0, len(names)):

        name = names[i]
        register_wallet = name_register_wallets[i]

        resp = testlib.blockstore_name_revoke(name, register_wallet.privkey)
        if debug or 'error' in resp:
            print json.dumps(resp, indent=4)

    # iterate the blocks a few times
    for i in xrange(0, 5):
        testlib.next_block(**kw)
Example #10
0
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)

    # will all be rejected trivially, since the first import must come from the importer's address
    testlib.blockstore_name_import("foo.test", wallets[4].addr, "11" * 20,
                                   wallets[2].privkey)
    testlib.blockstore_name_import("bar.test", wallets[2].addr, "22" * 20,
                                   wallets[3].privkey)
    testlib.blockstore_name_import("baz.test", wallets[3].addr, "33" * 20,
                                   wallets[4].privkey)
    testlib.next_block(**kw)

    # will be accepted
    testlib.blockstore_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.blockstore_name_import("foo.test", wallets[4].addr, "11" * 20,
                                   wallets[2].privkey)
    testlib.blockstore_name_import("bar.test", wallets[2].addr, "22" * 20,
                                   wallets[3].privkey)
    testlib.blockstore_name_import("baz.test", wallets[3].addr, "33" * 20,
                                   wallets[4].privkey)
    testlib.next_block(**kw)

    testlib.blockstore_namespace_ready("test", wallets[1].privkey)
    testlib.next_block(**kw)
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 )

    resp = testlib.blockstore_name_import( "foo.test", wallets[2].addr, "11" * 20, wallets[1].privkey )
    if 'error' in resp:
        print json.dumps(resp, indent=4 )

    testlib.next_block( **kw )

    # try to exceed quota (currently 25): order 25, and try to register a 26th
    for i in xrange(0, 25):
        resp = testlib.blockstore_name_import( "foo%s.test" % i, wallets[3].addr, "22" * 20, wallets[1].privkey )
        if 'error' in resp:
            print json.dumps(resp, indent=4 )

    testlib.next_block( **kw )

    # try to exceed quota (currently 25): order 26, and try to update one of them (and try to transfer one too).
    for i in xrange(0, 27):
        resp = testlib.blockstore_name_import( "bar%s.test" % i, wallets[4].addr, "33" * 20, wallets[1].privkey )
        if 'error' in resp:
            print json.dumps(resp, indent=4 )

    testlib.next_block( **kw )
    
    testlib.blockstore_namespace_ready( "test", wallets[1].privkey )
    testlib.next_block( **kw )

    print wallets[3].privkey
    resp = testlib.blockstore_name_preorder( "foofail.test", wallets[3].privkey, wallets[1].addr )
    if 'error' in resp:
       print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )

    # should fail 
    resp = testlib.blockstore_name_register( "foofail.test",wallets[3].privkey,  wallets[1].addr )
    if 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )

    # should succeed
    resp = testlib.blockstore_name_update( "foo0.test", '55' * 20, wallets[3].privkey )
    if 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )

    resp = testlib.blockstore_name_preorder( "barfail.test", wallets[4].privkey, wallets[2].addr )
    if 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )

    # should fail (exceeded quota)
    resp = testlib.blockstore_name_register( "barfail.test", wallets[4].privkey, wallets[2].addr )
    if 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )

    # should fail (exceeded quota--have to revoke or give names away)
    resp = testlib.blockstore_name_update( "bar0.test", '44' * 20, wallets[4].privkey )
    if 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )

    # should succeed (give a name away)
    resp = testlib.blockstore_name_transfer( "bar0.test", wallets[1].addr, True, wallets[4].privkey )
    if 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )

    # should fail (exceeded quota--have to revoke or give names away)
    resp = testlib.blockstore_name_update( "bar0.test", '44' * 20, wallets[4].privkey )
    if 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )

    # should succeed (revoke a name)
    resp = testlib.blockstore_name_revoke( "bar2.test", wallets[4].privkey )
    if 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )

    # should succeed (now under quota)
    resp = testlib.blockstore_name_update( "bar1.test", '66' * 20, wallets[4].privkey )
    if 'error' in resp:
        print json.dumps( resp, indent=4 )

    testlib.next_block( **kw )
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)

    resp = testlib.blockstore_name_import("foo.test", wallets[2].addr,
                                          "11" * 20, wallets[1].privkey)
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # try to exceed quota (currently 25): order 25, and try to register a 26th
    for i in xrange(0, 25):
        resp = testlib.blockstore_name_import("foo%s.test" % i,
                                              wallets[3].addr, "22" * 20,
                                              wallets[1].privkey)
        if 'error' in resp:
            print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # try to exceed quota (currently 25): order 26, and try to update one of them (and try to transfer one too).
    for i in xrange(0, 27):
        resp = testlib.blockstore_name_import("bar%s.test" % i,
                                              wallets[4].addr, "33" * 20,
                                              wallets[1].privkey)
        if 'error' in resp:
            print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    testlib.blockstore_namespace_ready("test", wallets[1].privkey)
    testlib.next_block(**kw)

    print wallets[3].privkey
    resp = testlib.blockstore_name_preorder("foofail.test", wallets[3].privkey,
                                            wallets[1].addr)
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # should fail
    resp = testlib.blockstore_name_register("foofail.test", wallets[3].privkey,
                                            wallets[1].addr)
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # should succeed
    resp = testlib.blockstore_name_update("foo0.test", '55' * 20,
                                          wallets[3].privkey)
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    resp = testlib.blockstore_name_preorder("barfail.test", wallets[4].privkey,
                                            wallets[2].addr)
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # should fail (exceeded quota)
    resp = testlib.blockstore_name_register("barfail.test", wallets[4].privkey,
                                            wallets[2].addr)
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # should fail (exceeded quota--have to revoke or give names away)
    resp = testlib.blockstore_name_update("bar0.test", '44' * 20,
                                          wallets[4].privkey)
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # should succeed (give a name away)
    resp = testlib.blockstore_name_transfer("bar0.test", wallets[1].addr, True,
                                            wallets[4].privkey)
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # should fail (exceeded quota--have to revoke or give names away)
    resp = testlib.blockstore_name_update("bar0.test", '44' * 20,
                                          wallets[4].privkey)
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # should succeed (revoke a name)
    resp = testlib.blockstore_name_revoke("bar2.test", wallets[4].privkey)
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # should succeed (now under quota)
    resp = testlib.blockstore_name_update("bar1.test", '66' * 20,
                                          wallets[4].privkey)
    if 'error' in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)
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 )

    # will all be rejected trivially, since the first import must come from the importer's address
    testlib.blockstore_name_import( "foo.test", wallets[4].addr, "11" * 20, wallets[2].privkey )
    testlib.blockstore_name_import( "bar.test", wallets[2].addr, "22" * 20, wallets[3].privkey )
    testlib.blockstore_name_import( "baz.test", wallets[3].addr, "33" * 20, wallets[4].privkey )
    testlib.next_block( **kw )
   
    # will be accepted 
    testlib.blockstore_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.blockstore_name_import( "foo.test", wallets[4].addr, "11" * 20, wallets[2].privkey )
    testlib.blockstore_name_import( "bar.test", wallets[2].addr, "22" * 20, wallets[3].privkey )
    testlib.blockstore_name_import( "baz.test", wallets[3].addr, "33" * 20, wallets[4].privkey )
    testlib.next_block( **kw )
    
    testlib.blockstore_namespace_ready( "test", wallets[1].privkey )
    testlib.next_block( **kw )
def scenario(wallets, **kw):

    # make a test namespace
    resp = testlib.blockstore_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.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,
    )
    if debug or "error" in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # import 3 names in the same block: foo.test, bar.test, baz.test
    names = ["foo.test", "bar.test", "baz.test"]
    name_preorder_wallets = [wallets[2], wallets[3], wallets[4]]
    name_register_wallets = [wallets[5], wallets[6], wallets[7]]
    name_transfer_wallets = [wallets[6], wallets[7], wallets[5]]

    for i in xrange(0, len(names)):

        name = names[i]
        register_wallet = name_register_wallets[i]

        resp = testlib.blockstore_name_import(name, register_wallet.addr, str(9 - i) * 40, wallets[1].privkey)
        if debug or "error" in resp:
            print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # namespace ready...
    resp = testlib.blockstore_namespace_ready("test", wallets[1].privkey)
    if debug or "error" in resp:
        print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # update 3 names in the same block
    for i in xrange(0, len(names)):

        name = names[i]
        register_wallet = name_register_wallets[i]

        resp = testlib.blockstore_name_update(name, str(i + 1) * 40, register_wallet.privkey)
        if debug or "error" in resp:
            print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # transfer 3 names in the same block
    for i in xrange(0, len(names)):

        name = names[i]
        register_wallet = name_register_wallets[i]
        transfer_wallet = name_transfer_wallets[i]

        resp = testlib.blockstore_name_transfer(name, transfer_wallet.addr, True, register_wallet.privkey)
        if debug or "error" in resp:
            print json.dumps(resp, indent=4)

    testlib.next_block(**kw)

    # exchange after transfer...
    tmp = name_register_wallets
    name_register_wallets = name_transfer_wallets
    name_transfer_wallets = tmp

    # revoke 3 names in the same block
    for i in xrange(0, len(names)):

        name = names[i]
        register_wallet = name_register_wallets[i]

        resp = testlib.blockstore_name_revoke(name, register_wallet.privkey)
        if debug or "error" in resp:
            print json.dumps(resp, indent=4)

    # iterate the blocks a few times
    for i in xrange(0, 5):
        testlib.next_block(**kw)