aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/functional_tests/transactions_flow_test.cpp12
-rw-r--r--tests/fuzz/fuzzer.cpp4
-rw-r--r--tests/unit_tests/ringdb.cpp8
3 files changed, 14 insertions, 10 deletions
diff --git a/tests/functional_tests/transactions_flow_test.cpp b/tests/functional_tests/transactions_flow_test.cpp
index 7248efade..25dcc77bc 100644
--- a/tests/functional_tests/transactions_flow_test.cpp
+++ b/tests/functional_tests/transactions_flow_test.cpp
@@ -84,10 +84,10 @@ bool do_send_money(tools::wallet2& w1, tools::wallet2& w2, size_t mix_in_factor,
try
{
- tools::wallet2::pending_tx ptx;
- std::vector<size_t> indices = w1.select_available_outputs([](const tools::wallet2::transfer_details&) { return true; });
- w1.transfer(dsts, mix_in_factor, indices, 0, TEST_FEE, std::vector<uint8_t>(), tools::detail::null_split_strategy, tools::tx_dust_policy(TEST_DUST_THRESHOLD), tx, ptx);
- w1.commit_tx(ptx);
+ std::vector<tools::wallet2::pending_tx> ptx;
+ ptx = w1.create_transactions_2(dsts, mix_in_factor, 0, 0, std::vector<uint8_t>(), 0, {});
+ for (auto &p: ptx)
+ w1.commit_tx(p);
return true;
}
catch (const std::exception&)
@@ -167,8 +167,8 @@ bool transactions_flow_test(std::string& working_folder,
daemon_req.miner_address = w1.get_account().get_public_address_str(MAINNET);
daemon_req.threads_count = 9;
r = net_utils::invoke_http_json("/start_mining", daemon_req, daemon_rsp, http_client, std::chrono::seconds(10));
- CHECK_AND_ASSERT_MES(r, false, "failed to get getrandom_outs");
- CHECK_AND_ASSERT_MES(daemon_rsp.status == CORE_RPC_STATUS_OK, false, "failed to getrandom_outs.bin");
+ CHECK_AND_ASSERT_MES(r, false, "failed to start mining getrandom_outs");
+ CHECK_AND_ASSERT_MES(daemon_rsp.status == CORE_RPC_STATUS_OK, false, "failed to start mining");
//wait for money, until balance will have enough money
w1.refresh(true, blocks_fetched, received_money, ok);
diff --git a/tests/fuzz/fuzzer.cpp b/tests/fuzz/fuzzer.cpp
index b81bf80fe..032ff049a 100644
--- a/tests/fuzz/fuzzer.cpp
+++ b/tests/fuzz/fuzzer.cpp
@@ -52,6 +52,10 @@ int run_fuzzer(int argc, const char **argv, Fuzzer &fuzzer)
return 1;
}
+#ifdef __AFL_HAVE_MANUAL_CONTROL
+ __AFL_INIT();
+#endif
+
int ret = fuzzer.init();
if (ret)
return ret;
diff --git a/tests/unit_tests/ringdb.cpp b/tests/unit_tests/ringdb.cpp
index 9b842569a..416ae0890 100644
--- a/tests/unit_tests/ringdb.cpp
+++ b/tests/unit_tests/ringdb.cpp
@@ -59,17 +59,17 @@ static crypto::key_image generate_key_image()
return key_image;
}
-static crypto::public_key generate_output()
+static std::pair<uint64_t, uint64_t> generate_output()
{
- return rct::rct2pk(rct::scalarmultBase(rct::skGen()));
+ return std::make_pair(rand(), rand());
}
static const crypto::chacha_key KEY_1 = generate_chacha_key();
static const crypto::chacha_key KEY_2 = generate_chacha_key();
static const crypto::key_image KEY_IMAGE_1 = generate_key_image();
-static const crypto::public_key OUTPUT_1 = generate_output();
-static const crypto::public_key OUTPUT_2 = generate_output();
+static const std::pair<uint64_t, uint64_t> OUTPUT_1 = generate_output();
+static const std::pair<uint64_t, uint64_t> OUTPUT_2 = generate_output();
class RingDB: public tools::ringdb
{