本文整理汇总了Python中testlib.blockstore_namespace_ready函数的典型用法代码示例。如果您正苦于以下问题:Python blockstore_namespace_ready函数的具体用法?Python blockstore_namespace_ready怎么用?Python blockstore_namespace_ready使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了blockstore_namespace_ready函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: scenario
def scenario(wallets, **kw):
testlib.blockstore_namespace_preorder("test", wallets[1].addr, wallets[0].privkey)
testlib.next_block(**kw)
# NOTE: names expire in 13 blocks
testlib.blockstore_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.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)
for i in xrange(0, 15):
testlib.next_block(**kw)
示例2: 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)
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)
示例3: scenario
def scenario( wallets, **kw ):
global working_dir
testlib.blockstore_namespace_preorder( "id", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
testlib.blockstore_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.blockstore_namespace_ready( "id", wallets[1].privkey )
testlib.next_block( **kw )
testlib.blockstore_name_preorder( "judecn.id", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
testlib.blockstore_name_register( "judecn.id", wallets[2].privkey, wallets[3].addr )
testlib.next_block( **kw )
resp = testlib.blockstore_announce( "hello world!", wallets[3].privkey )
if 'error' in resp:
print json.dumps( resp, indent=4 )
testlib.next_block( **kw )
resp = testlib.blockstore_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 )
示例4: 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 )
# 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 )
示例5: 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)
示例6: 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( "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.blockstore_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.blockstore_name_register( "foo.test", wallets[3].privkey, wallets[4].addr )
if 'error' in resp:
print json.dumps( resp )
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 )
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 )
testlib.blockstore_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)
testlib.blockstore_name_update( "foo.test", "22" * 20, wallets[3].privkey, consensus_hash=consensus_hash )
testlib.next_block( **kw )
示例8: 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 )
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 )
开发者ID:shaowenliu,项目名称:blockstore,代码行数:29,代码来源:namespace_preorder_reveal_import_multi_multikey_ready.py
示例9: 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)
示例10: 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 )
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 )
示例11: scenario
def scenario( wallets, **kw ):
global snv_consensus, snv_block_id, last_consensus, last_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 )
testlib.blockstore_name_update( "foo.test", "11" * 20, wallets[3].privkey )
testlib.next_block( **kw )
last_block_id = testlib.get_current_block()
last_consensus = testlib.get_consensus_at( last_block_id )
示例12: scenario
def scenario( wallets, **kw ):
global txids
global consensuses
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 )
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.blockstore_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 )
示例13: 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, 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.blockstore_namespace_ready( "test", wallets[1].privkey )
testlib.next_block( **kw )
# preorder, register, expire (multiple times)
for i in xrange(2, 5):
resp = testlib.blockstore_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.blockstore_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 )
示例14: scenario
def scenario( wallets, **kw ):
global snv_block_id, last_consensus
testlib.blockstore_namespace_preorder( "test", wallets[1].addr, wallets[0].privkey )
testlib.next_block( **kw )
# NOTE: names expire in 13 blocks
testlib.blockstore_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.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()
for i in xrange(0, 15):
testlib.next_block( **kw )
last_consensus = testlib.get_consensus_at( testlib.get_current_block() )
示例15: 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 )
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 )
# wait for a bit...
for i in xrange(0, 10):
testlib.next_block( **kw )
# has to be the same key that registered...
resp = testlib.blockstore_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 )