message: Add test for removal of pending txs from MST
diff: @@ -164,6 +164,48 @@ TEST_F(PendingTxsStorageFixture, ExactSize) {
  }
  }
  +/**
  + * All the transactions appeared in a proposal from pcs are not pending anymore
  + * @given A storage with a batch of two transactions
  + * @when a pcs emits an avent about received proposal
  + * @then all the mentioned txs have to be removed from MST's pending txs storage
  + */
  +TEST_F(PendingTxsStorageFixture, CompletedTransactionsAreRemoved) {
  + auto state = emptyState();
  + auto transactions = twoTransactionsBatch();
  + *state += transactions;
  +
  + const auto kPageSize = transactions->transactions().size();
  +
  + auto updates = updatesObservable({state});
  + auto prepared = updates.flat_map([&transactions](const auto &) {
  + return rxcpp::observable<>::just<
  + std::pair<shared_model::interface::types::AccountIdType,
  + shared_model::interface::types::HashType>>(
  + std::make_pair(transactions->transactions().front()->creatorAccountId(),
  + transactions->transactions().front()->hash()));
  + });
  +
  + iroha::PendingTransactionStorageImpl storage(
  + updates, dummyObservable(), dummyObservable(), prepared);
  + for (const auto &creator : {"alice@iroha", "bob@iroha"}) {
  + auto pending =
  + storage.getPendingTransactions(creator, kPageSize, boost::none);
  + pending.match(
  + [](const auto &response) {
  + auto &pending_txs = response.value.transactions;
  + EXPECT_EQ(pending_txs.size(), 0);
  + EXPECT_EQ(response.value.all_transactions_size, 0);
  + auto &next_batch_info = response.value.next_batch_info;
  + ASSERT_FALSE(next_batch_info);
  + },
  + [](const auto &error) {
  + FAIL() << "An error was not expected, the error code is "
  + << error.error;
  + });
  + }
  +}
  +
  /**
  * Correctly formed response is returned when queried page size smaller than the
  * size of the smallest batch
  