From e554b125cd1f5dae9742eeb4efe69ac2bac2b3c9 Mon Sep 17 00:00:00 2001 From: Gregory Coppola <60008382+gregorycoppola@users.noreply.github.com> Date: Thu, 22 Jul 2021 17:07:27 -0500 Subject: [PATCH] imported other tests --- testnet/stacks-node/src/tests/integrations.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/testnet/stacks-node/src/tests/integrations.rs b/testnet/stacks-node/src/tests/integrations.rs index a306b8b1a..2ee35e05b 100644 --- a/testnet/stacks-node/src/tests/integrations.rs +++ b/testnet/stacks-node/src/tests/integrations.rs @@ -399,6 +399,23 @@ fn integration_test_get_info() { burn_dbconn, bhh, &contract_identifier, "(test-11)"), Value::UInt(2)); + // The header hash for block at height u0 of the MocknetController, which + // simulates the Bitcoin chain, is always all 00's. + let burn_chain_height_result0 = chain_state.clarity_eval_read_only( + burn_dbconn, bhh, &contract_identifier, "(test-12-a)"); + let header_hash0 = hex_bytes("0000000000000000000000000000000000000000000000000000000000000000").unwrap(); + assert_eq!(burn_chain_height_result0, + Value::some(Value::buff_from(header_hash0).unwrap()).unwrap()); + + // The header hash for block at height u1 of the MocknetController, which + // simulates the Bitcoin chain, is always this hard-coded value. + // (See MocknetController::build_next_block_header). + let burn_chain_height_result1 = chain_state.clarity_eval_read_only( + burn_dbconn, bhh, &contract_identifier, "(test-12-b)"); + let header_hash1 = hex_bytes("66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925").unwrap(); + assert_eq!(burn_chain_height_result1, + Value::some(Value::buff_from(header_hash1).unwrap()).unwrap()); + }, 2 => { // Chain height should be 3