Skip to content

Commit

Permalink
small refactoring
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Drobny <[email protected]>
  • Loading branch information
vdrobnyi committed Feb 28, 2018
1 parent 99889f0 commit 8073974
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/module/irohad/ametsuchi/block_query_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class BlockQueryTest : public AmetsuchiTest {
.height(1)
.transactions(
std::vector<shared_model::proto::Transaction>({txn1_1, txn1_2}))
.prevHash(shared_model::crypto::Hash(std::string("0", 32)))
.prevHash(shared_model::crypto::Hash(zero_string))
.txNumber(2)
.build();

Expand Down Expand Up @@ -108,6 +108,7 @@ class BlockQueryTest : public AmetsuchiTest {
std::string creator1 = "user1@test";
std::string creator2 = "user2@test";
std::size_t blocks_total{0};
std::string zero_string = std::string("0", 32);
};

/**
Expand Down Expand Up @@ -188,7 +189,7 @@ TEST_F(BlockQueryTest, GetTransactionsExistingTxHashes) {
* @then nullopt values are retrieved
*/
TEST_F(BlockQueryTest, GetTransactionsIncludesNonExistingTxHashes) {
shared_model::crypto::Hash invalid_tx_hash_1(std::string("0", 32)),
shared_model::crypto::Hash invalid_tx_hash_1(zero_string),
invalid_tx_hash_2(std::string("9", 32));
auto wrapper = make_test_subscriber<CallExact>(
blocks->getTransactions({invalid_tx_hash_1, invalid_tx_hash_2}), 2);
Expand Down Expand Up @@ -221,7 +222,7 @@ TEST_F(BlockQueryTest, GetTransactionsWithEmpty) {
*/
TEST_F(BlockQueryTest, GetTransactionsWithInvalidTxAndValidTx) {
// TODO 15/11/17 motxx - Use EqualList VerificationStrategy
shared_model::crypto::Hash invalid_tx_hash_1(std::string("0", 32));
shared_model::crypto::Hash invalid_tx_hash_1(zero_string);
auto wrapper = make_test_subscriber<CallExact>(
blocks->getTransactions({invalid_tx_hash_1, tx_hashes[0]}), 2);
wrapper.subscribe([this](auto tx) {
Expand Down

0 comments on commit 8073974

Please sign in to comment.