mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
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.
This commit is contained in:
parent
eee44e62bc
commit
10da0a0b7c
7 changed files with 27 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue