コード例 #1
0
ファイル: Common.cpp プロジェクト: 285452612/bcos
AbridgedTopics dev::shh::abridge(Topics const& _topics)
{
	AbridgedTopics ret;
	ret.reserve(_topics.size());
	for (auto const& t: _topics)
		ret.push_back(abridge(t));
	return ret;
}
コード例 #2
0
static bool isTopicsEqual(const Topics& actualTopics, const Topics& expectedTopics)
{
    if (actualTopics.size() != expectedTopics.size()) {
        return false;
    }

    for (const auto& actualTopic : actualTopics) {
        bool found = false;
        for (const auto& expectedTopic : expectedTopics) {
            if (actualTopic.id == expectedTopic.id && actualTopic.name == expectedTopic.name &&
                    actualTopic.subscriptionType == expectedTopic.subscriptionType)
            {
                found = true;
                break;
            }
        }
        if (!found) {
            return false;
        }
    }

   return true;
}