From f141869cac2c099da0e121c4723951d4ac7c36f6 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 9 Dec 2015 17:30:30 +0000 Subject: tests: remove data-dir argument registration It is already registered in cryptonote::core::init_options, which we now call --- tests/core_tests/chaingen.h | 1 - 1 file changed, 1 deletion(-) (limited to 'tests/core_tests/chaingen.h') diff --git a/tests/core_tests/chaingen.h b/tests/core_tests/chaingen.h index 0c33b942e..7c989b94f 100644 --- a/tests/core_tests/chaingen.h +++ b/tests/core_tests/chaingen.h @@ -474,7 +474,6 @@ inline bool do_replay_events(std::vector& events) { boost::program_options::options_description desc("Allowed options"); cryptonote::core::init_options(desc); - command_line::add_arg(desc, command_line::arg_data_dir); boost::program_options::variables_map vm; bool r = command_line::handle_error_helper(desc, [&]() { -- cgit v1.2.3 From 10da0a0b7cc70fad0ffde60bdd04926484fb043a Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 13 Dec 2015 11:38:37 +0000 Subject: 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. --- tests/core_tests/chaingen.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/core_tests/chaingen.h') 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& 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 -- cgit v1.2.3 From c3d208fcbe7d32d2764a3cb8fae5653ae5de0f49 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 13 Dec 2015 13:56:15 +0000 Subject: core_tests: bump default test fee to 0.02 monero The current monero consensus uses 0.01 per kB fees, so use enough for 2 kB transactions for now. It'll probably have to be either bumped further or changed to calculate the proper fee. --- tests/core_tests/chaingen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/core_tests/chaingen.h') diff --git a/tests/core_tests/chaingen.h b/tests/core_tests/chaingen.h index fdcb62390..822ccfb11 100644 --- a/tests/core_tests/chaingen.h +++ b/tests/core_tests/chaingen.h @@ -674,4 +674,4 @@ inline bool do_replay_file(const std::string& filename) #define CHECK_EQ(v1, v2) CHECK_AND_ASSERT_MES(v1 == v2, false, "[" << perr_context << "] failed: \"" << QUOTEME(v1) << " == " << QUOTEME(v2) << "\", " << v1 << " != " << v2) #define CHECK_NOT_EQ(v1, v2) CHECK_AND_ASSERT_MES(!(v1 == v2), false, "[" << perr_context << "] failed: \"" << QUOTEME(v1) << " != " << QUOTEME(v2) << "\", " << v1 << " == " << v2) #define MK_COINS(amount) (UINT64_C(amount) * COIN) -#define TESTS_DEFAULT_FEE ((uint64_t)1000000) // pow(10, 6) +#define TESTS_DEFAULT_FEE ((uint64_t)20000000000) // 2 * pow(10, 10) -- cgit v1.2.3