aboutsummaryrefslogtreecommitdiff
path: root/tests/core_tests/chaingen.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-12-13 11:38:37 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-12-13 11:38:37 +0000
commit10da0a0b7cc70fad0ffde60bdd04926484fb043a (patch)
tree01c2dc48aef06f5494c1782c76b080f0f7de9e21 /tests/core_tests/chaingen.h
parentunit_tests: fix block reward test using post hard fork settings (diff)
downloadmonero-10da0a0b7cc70fad0ffde60bdd04926484fb043a.tar.xz
add a --fakechain argument for tests
The core tests use the blockchain, and reset it to be able to add test data to it. This does not play nice with the databases, since those will save that data without an explicit save call. We add a fakechain flag that the tests will set, which tells the core and blockchain code to use a separate database, as well as skip a few things like checkpoints and fixup, which only make sense for real data.
Diffstat (limited to 'tests/core_tests/chaingen.h')
-rw-r--r--tests/core_tests/chaingen.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/core_tests/chaingen.h b/tests/core_tests/chaingen.h
index 7c989b94f..fdcb62390 100644
--- a/tests/core_tests/chaingen.h
+++ b/tests/core_tests/chaingen.h
@@ -484,6 +484,10 @@ inline bool do_replay_events(std::vector<test_event_entry>& events)
if (!r)
return false;
+ // hardcode a --fakechain option for tests
+ static const char * const fakechain[] = {"", "--fakechain"};
+ boost::program_options::store(boost::program_options::parse_command_line(2, fakechain, desc), vm);
+
cryptonote::cryptonote_protocol_stub pr; //TODO: stub only for this kind of test, make real validation of relayed objects
cryptonote::core c(&pr);
// FIXME: make sure that vm has arg_testnet_on set to true or false if