aboutsummaryrefslogtreecommitdiff
path: root/src/test/alert_tests.cpp
diff options
context:
space:
mode:
authorJorge Timón <jtimon@jtimon.cc>2015-04-03 17:42:06 +0200
committerJorge Timón <jtimon@jtimon.cc>2015-04-04 12:58:14 +0200
commitf14e687feb554e64bf38715c001da0c0954be694 (patch)
tree390dd0216e1b94411e36a80f94864f9d160a00fe /src/test/alert_tests.cpp
parent2dc679d22f821d26a9f8a7eef6d095ef21d1b27c (diff)
Chainparams: Decouple CAlert from CChainParams
Diffstat (limited to 'src/test/alert_tests.cpp')
-rw-r--r--src/test/alert_tests.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/test/alert_tests.cpp b/src/test/alert_tests.cpp
index 5e1f5f0294..6b6df5199a 100644
--- a/src/test/alert_tests.cpp
+++ b/src/test/alert_tests.cpp
@@ -10,6 +10,7 @@
#include "clientversion.h"
#include "data/alertTests.raw.h"
+#include "chainparams.h"
#include "serialize.h"
#include "streams.h"
#include "util.h"
@@ -119,10 +120,11 @@ BOOST_FIXTURE_TEST_SUITE(Alert_tests, ReadAlerts)
BOOST_AUTO_TEST_CASE(AlertApplies)
{
SetMockTime(11);
+ const std::vector<unsigned char>& alertKey = Params(CBaseChainParams::MAIN).AlertKey();
BOOST_FOREACH(const CAlert& alert, alerts)
{
- BOOST_CHECK(alert.CheckSignature());
+ BOOST_CHECK(alert.CheckSignature(alertKey));
}
BOOST_CHECK(alerts.size() >= 3);
@@ -159,6 +161,7 @@ BOOST_AUTO_TEST_CASE(AlertApplies)
BOOST_AUTO_TEST_CASE(AlertNotify)
{
SetMockTime(11);
+ const std::vector<unsigned char>& alertKey = Params(CBaseChainParams::MAIN).AlertKey();
boost::filesystem::path temp = GetTempPath() / "alertnotify.txt";
boost::filesystem::remove(temp);
@@ -166,7 +169,7 @@ BOOST_AUTO_TEST_CASE(AlertNotify)
mapArgs["-alertnotify"] = std::string("echo %s >> ") + temp.string();
BOOST_FOREACH(CAlert alert, alerts)
- alert.ProcessAlert(false);
+ alert.ProcessAlert(alertKey, false);
std::vector<std::string> r = read_lines(temp);
BOOST_CHECK_EQUAL(r.size(), 4u);