From d64fd6cd60c8a1369e1f72251248ee8362f0a31b Mon Sep 17 00:00:00 2001 From: Ludo Galabru Date: Thu, 28 Jan 2021 21:40:00 -0500 Subject: [PATCH] fix: atlas + atlas tests --- src/net/atlas/db.rs | 2 +- testnet/stacks-node/src/tests/neon_integrations.rs | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/net/atlas/db.rs b/src/net/atlas/db.rs index c118be950..465d48f62 100644 --- a/src/net/atlas/db.rs +++ b/src/net/atlas/db.rs @@ -387,7 +387,7 @@ impl AtlasDB { content_hash: &Hash160, ) -> Result, db_error> { let hex_content_hash = to_hex(&content_hash.0[..]); - let qry = "SELECT content, hash FROM attachments WHERE hash = ?1 AND was_instantiated = 0" + let qry = "SELECT content, hash FROM attachments WHERE hash = ?1 AND was_instantiated = 1" .to_string(); let args = [&hex_content_hash as &dyn ToSql]; let row = query_row::(&self.conn, &qry, &args)?; diff --git a/testnet/stacks-node/src/tests/neon_integrations.rs b/testnet/stacks-node/src/tests/neon_integrations.rs index e77796418..3a6b3f465 100644 --- a/testnet/stacks-node/src/tests/neon_integrations.rs +++ b/testnet/stacks-node/src/tests/neon_integrations.rs @@ -2065,7 +2065,7 @@ fn atlas_integration_test() { "namespace-preorder", &[ Value::buff_from(hashed_namespace.to_bytes().to_vec()).unwrap(), - Value::UInt(1000), + Value::UInt(1000000000), ], ); @@ -2213,12 +2213,10 @@ fn atlas_integration_test() { panic!(""); } - // From there, let's mine these transaction, and build an extra block. + // From there, let's mine these transaction, and build more blocks. let mut sort_height = channel.get_sortitions_processed(); - eprintln!("=> Sort height: {}", sort_height); - let few_blocks = sort_height + 1 + 1; + let few_blocks = sort_height + 5; - // now let's mine until the next reward cycle starts ... while sort_height < few_blocks { next_block_and_wait(&mut btc_regtest_controller, &blocks_processed); sort_height = channel.get_sortitions_processed(); @@ -2237,10 +2235,9 @@ fn atlas_integration_test() { _ => panic!("Bootstrap node could nod boot. Aborting test."), }; - // From there, let's mine these transaction, and build an extra block. + // From there, let's mine these transaction, and build more blocks. let mut sort_height = channel.get_sortitions_processed(); - eprintln!("=> Sort height: {}", sort_height); - let few_blocks = sort_height + 1 + 1; + let few_blocks = sort_height + 5; while sort_height < few_blocks { next_block_and_wait(&mut btc_regtest_controller, &blocks_processed);