aboutsummaryrefslogtreecommitdiffstats
path: root/whisperTopic.cpp
diff options
context:
space:
mode:
authorGav Wood <i@gavwood.com>2015-01-30 07:26:08 +0800
committerGav Wood <i@gavwood.com>2015-01-30 08:14:50 +0800
commit72af3456dfe680efb48991edb5a331fbe4d3587e (patch)
tree3b492ab18cbe6b8dbe85669ec2152583a750191a /whisperTopic.cpp
parent27f3e92a2f33433940781089bbe22db88b434c93 (diff)
downloaddexon-solidity-72af3456dfe680efb48991edb5a331fbe4d3587e.tar.gz
dexon-solidity-72af3456dfe680efb48991edb5a331fbe4d3587e.tar.zst
dexon-solidity-72af3456dfe680efb48991edb5a331fbe4d3587e.zip
Various fixes.
Diffstat (limited to 'whisperTopic.cpp')
-rw-r--r--whisperTopic.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/whisperTopic.cpp b/whisperTopic.cpp
index a47b0a57..635defd7 100644
--- a/whisperTopic.cpp
+++ b/whisperTopic.cpp
@@ -34,7 +34,7 @@ BOOST_AUTO_TEST_CASE(topic)
{
cnote << "Testing Whisper...";
auto oldLogVerbosity = g_logVerbosity;
- g_logVerbosity = 0;
+ g_logVerbosity = 4;
bool started = false;
unsigned result = 0;
@@ -46,16 +46,16 @@ BOOST_AUTO_TEST_CASE(topic)
auto wh = ph.registerCapability(new WhisperHost());
ph.start();
- started = true;
-
/// Only interested in odd packets
auto w = wh->installWatch(BuildTopicMask("odd"));
- for (int i = 0, last = 0; i < 200 && last < 81; ++i)
+ started = true;
+
+ for (int iterout = 0, last = 0; iterout < 200 && last < 81; ++iterout)
{
for (auto i: wh->checkWatch(w))
{
- Message msg = wh->envelope(i).open(wh->filterKey());
+ Message msg = wh->envelope(i).open(wh->filterKey(w));
last = RLP(msg.payload()).toInt<unsigned>();
cnote << "New message from:" << msg.from().abridged() << RLP(msg.payload()).toInt<unsigned>();
result += last;
@@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE(forwarding)
{
for (auto i: wh->checkWatch(w))
{
- Message msg = wh->envelope(i).open();
+ Message msg = wh->envelope(i).open(wh->filterKey(w));
unsigned last = RLP(msg.payload()).toInt<unsigned>();
cnote << "New message from:" << msg.from().abridged() << RLP(msg.payload()).toInt<unsigned>();
result = last;
@@ -152,7 +152,7 @@ BOOST_AUTO_TEST_CASE(forwarding)
{
for (auto i: wh->checkWatch(w))
{
- Message msg = wh->envelope(i).open();
+ Message msg = wh->envelope(i).open(wh->filterKey(w));
cnote << "New message from:" << msg.from().abridged() << RLP(msg.payload()).toInt<unsigned>();
}
this_thread::sleep_for(chrono::milliseconds(50));
@@ -215,7 +215,7 @@ BOOST_AUTO_TEST_CASE(asyncforwarding)
{
for (auto i: wh->checkWatch(w))
{
- Message msg = wh->envelope(i).open();
+ Message msg = wh->envelope(i).open(wh->filterKey(w));
cnote << "New message from:" << msg.from().abridged() << RLP(msg.payload()).toInt<unsigned>();
}
this_thread::sleep_for(chrono::milliseconds(50));
@@ -255,7 +255,7 @@ BOOST_AUTO_TEST_CASE(asyncforwarding)
{
for (auto i: wh->checkWatch(w))
{
- Message msg = wh->envelope(i).open();
+ Message msg = wh->envelope(i).open(wh->filterKey(w));
unsigned last = RLP(msg.payload()).toInt<unsigned>();
cnote << "New message from:" << msg.from().abridged() << RLP(msg.payload()).toInt<unsigned>();
result = last;