mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-14 12:06:42 +08:00
bitcoind can reorder transactions. accomodate this
This commit is contained in:
@@ -44,14 +44,12 @@ def scenario( wallets, **kw ):
|
||||
|
||||
testlib.blockstack_namespace_ready( "test", wallets[1].privkey )
|
||||
testlib.next_block( **kw )
|
||||
|
||||
|
||||
testlib.blockstack_name_preorder( "foo.test", wallets[4].privkey, wallets[3].addr )
|
||||
testlib.blockstack_name_preorder( "foo.test", wallets[3].privkey, wallets[2].addr )
|
||||
|
||||
# should be accepted
|
||||
# at most one of these will be accepted
|
||||
testlib.blockstack_name_register( "foo.test", wallets[4].privkey, wallets[3].addr )
|
||||
|
||||
# should be rejected
|
||||
testlib.blockstack_name_register( "foo.test", wallets[3].privkey, wallets[2].addr )
|
||||
|
||||
testlib.next_block( **kw )
|
||||
@@ -88,10 +86,14 @@ def check( state_engine ):
|
||||
return False
|
||||
|
||||
# owned by
|
||||
if name_rec['address'] != wallets[3].addr or name_rec['sender'] != virtualchain.make_payment_script(wallets[3].addr):
|
||||
found = False
|
||||
for i in [2,3]:
|
||||
if name_rec['address'] == wallets[i].addr or name_rec['sender'] == virtualchain.make_payment_script(wallets[i].addr):
|
||||
found = True
|
||||
break
|
||||
|
||||
if not found:
|
||||
print "sender is wrong"
|
||||
print 'expected {}'.format(wallets[3].addr)
|
||||
print 'got {}'.format(name_rec['address'])
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user