Skip to content

Commit

Permalink
Merge pull request #1020 from evoskuil/version3
Browse files Browse the repository at this point in the history
Unreverse regtest activation hashes.
  • Loading branch information
evoskuil committed Aug 24, 2018
2 parents c2484f8 + a5c88dd commit e984307
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions include/bitcoin/bitcoin/constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ static const config::checkpoint testnet_bip34_active_checkpoint
static const config::checkpoint regtest_bip34_active_checkpoint
{
// Since bip90 assumes a historical bip34 activation block, use genesis.
"06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f", 0
"0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206", 0
};

// These cannot be reactivated in a future branch due to window expiration.
Expand All @@ -204,7 +204,7 @@ static const config::checkpoint testnet_bip9_bit0_active_checkpoint
static const config::checkpoint regtest_bip9_bit0_active_checkpoint
{
// The activation window is fixed and closed, so assume genesis activation.
"06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f", 0
"0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206", 0
};

// These cannot be reactivated in a future branch due to window expiration.
Expand All @@ -219,7 +219,7 @@ static const config::checkpoint testnet_bip9_bit1_active_checkpoint
static const config::checkpoint regtest_bip9_bit1_active_checkpoint
{
// The activation window is fixed and closed, so assume genesis activation.
"06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f", 0
"0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206", 0
};

// Network protocol constants.
Expand Down
9 changes: 7 additions & 2 deletions test/chain/block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ BOOST_AUTO_TEST_CASE(block__from_data__insufficient_bytes__failure)

BOOST_AUTO_TEST_CASE(block__from_data__insufficient_transaction_bytes__failure)
{
const data_chunk data = to_chunk(base16_literal(
const auto data = to_chunk(base16_literal(
"010000007f110631052deeee06f0754a3629ad7663e56359fd5f3aa7b3e30a00"
"000000005f55996827d9712147a8eb6d7bae44175fe0bcfa967e424a25bfe9f4"
"dc118244d67fb74c9d8e2f1bea5ee82a03010000000100000000000000000000"
Expand All @@ -274,29 +274,34 @@ BOOST_AUTO_TEST_CASE(block__from_data__insufficient_transaction_bytes__failure)

BOOST_AUTO_TEST_CASE(block__genesis__mainnet__valid_structure)
{
const auto genesis_hash = hash_literal("000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f");
const auto genesis = bc::chain::block::genesis_mainnet();
BOOST_REQUIRE(genesis.is_valid());
BOOST_REQUIRE_EQUAL(genesis.transactions().size(), 1u);
BOOST_REQUIRE(genesis.header().merkle() == genesis.generate_merkle_root());
BOOST_REQUIRE(genesis.hash() == genesis_hash);
}

BOOST_AUTO_TEST_CASE(block__genesis__testnet__valid_structure)
{
const auto genesis_hash = hash_literal("000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943");
const auto genesis = bc::chain::block::genesis_testnet();
BOOST_REQUIRE(genesis.is_valid());
BOOST_REQUIRE_EQUAL(genesis.transactions().size(), 1u);
BOOST_REQUIRE(genesis.header().merkle() == genesis.generate_merkle_root());
BOOST_REQUIRE(genesis.hash() == genesis_hash);
}

BOOST_AUTO_TEST_CASE(block__genesis__regtest__valid_structure)
{
const auto genesis_hash = hash_literal("0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206");
const auto genesis = bc::chain::block::genesis_regtest();
BOOST_REQUIRE(genesis.is_valid());
BOOST_REQUIRE_EQUAL(genesis.transactions().size(), 1u);
BOOST_REQUIRE(genesis.header().merkle() == genesis.generate_merkle_root());
BOOST_REQUIRE(genesis.hash() == genesis_hash);
}


BOOST_AUTO_TEST_CASE(block__factory_from_data_1__genesis_mainnet__success)
{
const auto genesis = bc::chain::block::genesis_mainnet();
Expand Down

0 comments on commit e984307

Please sign in to comment.