Skip to content

Commit

Permalink
Fix mismatch in prize list with item config.
Browse files Browse the repository at this point in the history
Update the prize name for the SME shares to match the name in the
roconfig item data.  Also add a test to ensure all prizes match
the corresponding item data.
  • Loading branch information
domob1812 committed Dec 22, 2019
1 parent 76bfe31 commit 7fc883b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const std::vector<Params::PrizeData> PRIZES =
{"Enjin Legend: Maxim", 1, 65145},
{"RC 9MM BTC skinned", 10, 10559},
{"30,000 SHR coins", 10, 10559},
{"1%% shares in a soccer club", 10, 10559},
{"1% shares in a soccer club", 10, 10559},
{"Warmongers", 5, 18765},
{"Limited Edition Varag Shamans", 30, 4033},
{"Holy Knights", 30, 4033},
Expand Down
20 changes: 20 additions & 0 deletions src/prospecting_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "database/dbtest.hpp"
#include "database/prizes.hpp"
#include "hexagonal/coord.hpp"
#include "proto/roconfig.hpp"

#include <gtest/gtest.h>

Expand Down Expand Up @@ -289,5 +290,24 @@ TEST_F (FinishProspectingTests, FewerPrizesInCentre)

/* ************************************************************************** */

TEST (PrizesTests, AllInItemConfig)
{
const auto& itemData = RoConfigData ().fungible_items ();

for (const xaya::Chain c : {xaya::Chain::MAIN, xaya::Chain::TEST,
xaya::Chain::REGTEST})
{
const Params params(c);
for (const auto& p : params.ProspectingPrizes ())
{
const auto mit = itemData.find (p.name + " prize");
ASSERT_FALSE (mit == itemData.end ())
<< "Prize item not defined: " << p.name;
}
}
}

/* ************************************************************************** */

} // anonymous namespace
} // namespace pxd

0 comments on commit 7fc883b

Please sign in to comment.