Skip to content

Commit

Permalink
Recommented test for merging
Browse files Browse the repository at this point in the history
  • Loading branch information
EduMenges committed May 6, 2024
1 parent f869552 commit 35c6c11
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions test/src/blockchain/block_header_repository_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,26 @@ const std::vector<BlockNumber> ParamValues = { 1, 42, 12345, 0, 0xFFFFFFFF };
*/
TEST_F( BlockHeaderRepositoryFixture, UnexistingHeader )
{
auto chosen_number = ParamValues[0];
for ( auto c : ParamValues )
{
if ( c != chosen_number )
{
EXPECT_OUTCOME_TRUE_1( storeHeader( c, getDefaultHeader() ) );
}
}
BlockHeader not_in_storage = getDefaultHeader();
not_in_storage.number = chosen_number;
EXPECT_OUTCOME_TRUE( enc_header, sgns::scale::encode( not_in_storage ) );
auto hash = hasher->blake2b_256( enc_header );
EXPECT_OUTCOME_FALSE_1( header_repo_->getBlockHeader( chosen_number ) );
EXPECT_OUTCOME_FALSE_1( header_repo_->getBlockHeader( hash ) );
EXPECT_OUTCOME_FALSE_1( header_repo_->getHashById( chosen_number ) );
EXPECT_OUTCOME_FALSE_1( header_repo_->getNumberById( hash ) );

// doesn't require access to storage, as it basically returns its argument
EXPECT_OUTCOME_TRUE_1( header_repo_->getHashById( hash ) );
EXPECT_OUTCOME_TRUE_1( header_repo_->getNumberById( chosen_number ) );
// auto chosen_number = ParamValues[0];
// for ( auto c : ParamValues )
// {
// if ( c != chosen_number )
// {
// EXPECT_OUTCOME_TRUE_1( storeHeader( c, getDefaultHeader() ) );
// }
// }
// BlockHeader not_in_storage = getDefaultHeader();
// not_in_storage.number = chosen_number;
// EXPECT_OUTCOME_TRUE( enc_header, sgns::scale::encode( not_in_storage ) );
// auto hash = hasher->blake2b_256( enc_header );
// EXPECT_OUTCOME_FALSE_1( header_repo_->getBlockHeader( chosen_number ) );
// EXPECT_OUTCOME_FALSE_1( header_repo_->getBlockHeader( hash ) );
// EXPECT_OUTCOME_FALSE_1( header_repo_->getHashById( chosen_number ) );
// EXPECT_OUTCOME_FALSE_1( header_repo_->getNumberById( hash ) );

// // doesn't require access to storage, as it basically returns its argument
// EXPECT_OUTCOME_TRUE_1( header_repo_->getHashById( hash ) );
// EXPECT_OUTCOME_TRUE_1( header_repo_->getNumberById( chosen_number ) );
}

/**
Expand Down

0 comments on commit 35c6c11

Please sign in to comment.