diff --git a/integration_tests/blockstack_integration_tests/scenarios/name_pre_reg_collisions.py b/integration_tests/blockstack_integration_tests/scenarios/name_pre_reg_collisions.py index 3dbe9ebf8..a0e9a899c 100644 --- a/integration_tests/blockstack_integration_tests/scenarios/name_pre_reg_collisions.py +++ b/integration_tests/blockstack_integration_tests/scenarios/name_pre_reg_collisions.py @@ -60,6 +60,7 @@ def scenario( wallets, **kw ): print json.dumps( resp, indent=4 ) testlib.next_block( **kw ) + testlib.expect_snv_fail_at('test', testlib.get_current_block(**kw)) # should get accepted resp = 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, safety_checks=False ) @@ -72,6 +73,7 @@ def scenario( wallets, **kw ): print json.dumps( resp, indent=4 ) testlib.next_block( **kw ) + testlib.expect_snv_fail_at('test', testlib.get_current_block(**kw)) resp = testlib.blockstack_namespace_ready( "test", wallets[1].privkey, safety_checks=False ) if debug or 'error' in resp: diff --git a/integration_tests/blockstack_integration_tests/scenarios/namespace_preorder_reveal_ready_nodups.py b/integration_tests/blockstack_integration_tests/scenarios/namespace_preorder_reveal_ready_nodups.py index 45537434f..c5520a65f 100644 --- a/integration_tests/blockstack_integration_tests/scenarios/namespace_preorder_reveal_ready_nodups.py +++ b/integration_tests/blockstack_integration_tests/scenarios/namespace_preorder_reveal_ready_nodups.py @@ -50,6 +50,7 @@ def scenario( wallets, **kw ): print json.dumps( resp, indent=4 ) testlib.next_block( **kw ) + testlib.expect_snv_fail_at('test', testlib.get_current_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 ) @@ -63,18 +64,21 @@ def scenario( wallets, **kw ): print json.dumps( resp, indent=4 ) testlib.next_block( **kw ) + testlib.expect_snv_fail_at('test', testlib.get_current_block(**kw)) resp = testlib.blockstack_namespace_reveal( "test", wallets[3].addr, 52595, 251, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[4].privkey ) if 'error' in resp: print json.dumps( resp, indent=4 ) testlib.next_block( **kw ) + testlib.expect_snv_fail_at('test', testlib.get_current_block(**kw)) resp = testlib.blockstack_namespace_ready( "test", wallets[4].privkey ) if 'error' in resp: print json.dumps( resp, indent=4 ) testlib.next_block( **kw ) + testlib.expect_snv_fail_at('test', testlib.get_current_block(**kw)) # can't re-reveal test resp = testlib.blockstack_namespace_reveal( "test", wallets[1].addr, 52595, 252, 4, [6,5,4,3,2,1,0,0,0,0,0,0,0,0,0,0], 10, 10, wallets[0].privkey ) @@ -82,6 +86,7 @@ def scenario( wallets, **kw ): print json.dumps( resp, indent=4 ) testlib.next_block( **kw ) + testlib.expect_snv_fail_at('test', testlib.get_current_block(**kw)) # can't re-ready test resp = testlib.blockstack_namespace_ready( "test", wallets[1].privkey ) @@ -89,6 +94,7 @@ def scenario( wallets, **kw ): print json.dumps( resp, indent=4 ) testlib.next_block( **kw ) + testlib.expect_snv_fail_at('test', testlib.get_current_block(**kw)) # warn the serialization checker that this changes behavior from 0.13 print "BLOCKSTACK_SERIALIZATION_CHANGE_BEHAVIOR" diff --git a/integration_tests/blockstack_integration_tests/scenarios/rest_register_recipient_minconfs.py b/integration_tests/blockstack_integration_tests/scenarios/rest_register_recipient_minconfs.py index b48ad7cb9..1dcb3cf53 100644 --- a/integration_tests/blockstack_integration_tests/scenarios/rest_register_recipient_minconfs.py +++ b/integration_tests/blockstack_integration_tests/scenarios/rest_register_recipient_minconfs.py @@ -81,15 +81,14 @@ def scenario( wallets, **kw ): print 'accidentally succeeded to preorder test2' return False - testlib.expect_snv_fail_at( "foo.test", testlib.get_current_block(**kw)+1) - # try to reveal; it should fail res = 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 ) if 'error' not in res: print 'accidentally succeeded to reveal test' return False - testlib.expect_snv_fail_at( "foo.test", testlib.get_current_block(**kw)+1) + testlib.expect_snv_fail_at( "test2", testlib.get_current_block(**kw)+1) + testlib.expect_snv_fail_at( "test", testlib.get_current_block(**kw)+1) for i in xrange(0, 3): testlib.next_block( **kw ) @@ -109,7 +108,7 @@ def scenario( wallets, **kw ): print res return False - testlib.expect_snv_fail_at( "foo.test", testlib.get_current_block(**kw)+1) + testlib.expect_snv_fail_at( "test", testlib.get_current_block(**kw)+1) for i in xrange(0, 3): testlib.next_block( **kw ) diff --git a/integration_tests/blockstack_integration_tests/scenarios/testlib.py b/integration_tests/blockstack_integration_tests/scenarios/testlib.py index 1e69626cd..fc354a3ea 100644 --- a/integration_tests/blockstack_integration_tests/scenarios/testlib.py +++ b/integration_tests/blockstack_integration_tests/scenarios/testlib.py @@ -268,7 +268,7 @@ def expect_snv_fail_at( name, block_id ): """ global snv_fail_at - if name not in snv_fail_at.keys(): + if block_id not in snv_fail_at.keys(): snv_fail_at[block_id] = [name] else: snv_fail_at[block_id].append(name) @@ -2981,6 +2981,10 @@ def snv_all_names( state_engine ): log.debug("SNV lookup %s failed at %s as expected" % (name, block_id)) continue + print 'SNV lookup on {} at {} with {} failed'.format(name, block_id, trusted_consensus_hash) + print 'Expected SNV failures at {}: {}'.format(block_id, snv_fail_at.get(block_id, [])) + print 'All SNV failures expected:\n{}'.format(json.dumps(snv_fail_at, indent=4, sort_keys=True)) + print 'SNV lookup return value:' print json.dumps(snv_recs, indent=4, sort_keys=True ) return False