コード例 #1
0
ファイル: whisperMessage.cpp プロジェクト: EarthDollar/farmer
Topics createRandomTopics(unsigned int i)
{
	Topics ret;
	h256 t(i);

	for (int j = 0; j < 8; ++j)
	{
		t = sha3(t);
		ret.push_back(t);
	}

	return ret;
}
コード例 #2
0
ファイル: whisperMessage.cpp プロジェクト: EarthDollar/farmer
void sealAndOpenSingleMessage(unsigned int i)
{
	Secret zero;
	Topics topics = createRandomTopics(i);
	bytes const payload = createRandomPayload(i);
	Message m1(payload);
	Envelope e = m1.seal(zero, topics, 1, 1);

	for (auto const& t: topics)
	{
		Topics singleTopic;
		singleTopic.push_back(t);
		Message m2(e, singleTopic, zero);
		comparePayloads(m1, m2);
	}
}