bitcoind can reorder transactions. accomodate this

This commit is contained in:
Jude Nelson
2018-01-17 22:31:57 -05:00
parent 066ba602c9
commit c3484c0d7e

View File

@@ -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