From 1be00ea3c8187f1d3f8f92620adab479b0952d20 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Sun, 28 Jan 2024 19:40:34 +0100 Subject: [PATCH] got rid of warnings --- src/crypto/zarcanum.cpp | 2 +- src/currency_core/blockchain_storage.cpp | 1 - src/currency_core/currency_format_utils.cpp | 1 - src/wallet/wallet_rpc_server.cpp | 4 ++-- tests/core_tests/chaingen.cpp | 3 --- tests/core_tests/ionic_swap_tests.cpp | 2 +- tests/core_tests/multiassets_test.cpp | 2 -- tests/core_tests/zarcanum_test.cpp | 6 ------ 8 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/crypto/zarcanum.cpp b/src/crypto/zarcanum.cpp index f5f32aa9..e0b81f44 100644 --- a/src/crypto/zarcanum.cpp +++ b/src/crypto/zarcanum.cpp @@ -205,7 +205,7 @@ namespace crypto TRY_ENTRY() { DBG_PRINT("zarcanum_verify_proof"); - bool r = false; + //bool r = false; //std::cout << "===== zarcanum_verify_proof =====" << ENDL // << "m: " << m << ENDL diff --git a/src/currency_core/blockchain_storage.cpp b/src/currency_core/blockchain_storage.cpp index c9f40759..31cd3a5e 100644 --- a/src/currency_core/blockchain_storage.cpp +++ b/src/currency_core/blockchain_storage.cpp @@ -2711,7 +2711,6 @@ bool blockchain_storage::get_target_outs_for_amount_prezarcanum(const COMMAND_RP { std::set used; used.insert(details.own_global_index); - size_t try_count = 0; for (uint64_t j = 0; j != decoys_count || used.size() >= up_index_limit;) { size_t g_index_initial = crypto::rand() % up_index_limit; diff --git a/src/currency_core/currency_format_utils.cpp b/src/currency_core/currency_format_utils.cpp index ce50f866..2111be68 100644 --- a/src/currency_core/currency_format_utils.cpp +++ b/src/currency_core/currency_format_utils.cpp @@ -129,7 +129,6 @@ namespace currency //-------------------------------------------------------------------------------- bool verify_asset_surjection_proof(const transaction& tx, const crypto::hash& tx_id) { - bool r = false; if (tx.version <= TRANSACTION_VERSION_PRE_HF4) return true; diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index a1e8024e..498af626 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -1053,7 +1053,7 @@ namespace tools { WALLET_RPC_BEGIN_TRY_ENTRY(); std::string buff = epee::string_encoding::base64_decode(req.buff); - bool r = w.get_wallet()->encrypt_buffer(buff, res.res_buff); + w.get_wallet()->encrypt_buffer(buff, res.res_buff); res.res_buff = epee::string_encoding::base64_encode(res.res_buff); return true; WALLET_RPC_CATCH_TRY_ENTRY(); @@ -1063,7 +1063,7 @@ namespace tools { WALLET_RPC_BEGIN_TRY_ENTRY(); std::string buff = epee::string_encoding::base64_decode(req.buff); - bool r = w.get_wallet()->encrypt_buffer(buff, res.res_buff); + w.get_wallet()->encrypt_buffer(buff, res.res_buff); res.res_buff = epee::string_encoding::base64_encode(res.res_buff); return true; WALLET_RPC_CATCH_TRY_ENTRY(); diff --git a/tests/core_tests/chaingen.cpp b/tests/core_tests/chaingen.cpp index 7b68213c..7fb7873f 100644 --- a/tests/core_tests/chaingen.cpp +++ b/tests/core_tests/chaingen.cpp @@ -1193,8 +1193,6 @@ namespace bool init_output_indices(map_output_idx_t& outs, map_output_t& outs_mine, const std::vector& blockchain, const map_hash2tx_t& mtx, const currency::account_keys& acc_keys) { - bool r = false; - for (const block& blk : blockchain) { uint64_t height = get_block_height(blk); @@ -2338,7 +2336,6 @@ bool shuffle_source_entries(std::vector& sources) // creates destinations.size() + 1 outputs if the total sum of amounts is less than the original premine amount (the last one will have amount = old_premine - sum) bool replace_coinbase_in_genesis_block(const std::vector& destinations, test_generator& generator, std::vector& events, currency::block& genesis_block) { - bool r = false; generator.remove_block_info(genesis_block); events.pop_back(); diff --git a/tests/core_tests/ionic_swap_tests.cpp b/tests/core_tests/ionic_swap_tests.cpp index a47a17a5..e5f96f3d 100644 --- a/tests/core_tests/ionic_swap_tests.cpp +++ b/tests/core_tests/ionic_swap_tests.cpp @@ -375,7 +375,7 @@ bool ionic_swap_exact_amounts_test::c1(currency::core& c, size_t ev_index, const CHECK_AND_ASSERT_MES(check_balance_via_wallet(*bob_wlt, "Bob", adb.total_max_supply, 0, adb.total_max_supply, 0, 0, asset_id), false, ""); CHECK_AND_ASSERT_MES(check_balance_via_wallet(*carol_wlt, "Carol", MK_TEST_COINS(21), 0, MK_TEST_COINS(21), 0, 0), false, ""); - size_t current_blockchain_size = c.get_current_blockchain_size(); + //size_t current_blockchain_size = c.get_current_blockchain_size(); // Normal ionic swap between Alice and Bob: (Alice has only coins with explicit asset id) // before: diff --git a/tests/core_tests/multiassets_test.cpp b/tests/core_tests/multiassets_test.cpp index a186d7bb..daa40637 100644 --- a/tests/core_tests/multiassets_test.cpp +++ b/tests/core_tests/multiassets_test.cpp @@ -716,8 +716,6 @@ bool assets_and_pos_mining::generate(std::vector& events) cons { // Test idea: ensure that post-HF4 Zarcanum staking functions correctly with outputs that have a nonzero asset id blinding mask (i.e., outputs with a non-explicit asset id) - bool r = false; - uint64_t ts = test_core_time::get_time(); m_accounts.resize(TOTAL_ACCS_COUNT); account_base& miner_acc = m_accounts[MINER_ACC_IDX]; miner_acc.generate(); miner_acc.set_createtime(ts); diff --git a/tests/core_tests/zarcanum_test.cpp b/tests/core_tests/zarcanum_test.cpp index 535ba477..40b431c9 100644 --- a/tests/core_tests/zarcanum_test.cpp +++ b/tests/core_tests/zarcanum_test.cpp @@ -422,8 +422,6 @@ zarcanum_pos_block_math::zarcanum_pos_block_math() bool zarcanum_pos_block_math::generate(std::vector& events) const { - bool r = false; - GENERATE_ACCOUNT(miner_acc); MAKE_GENESIS_BLOCK(events, blk_0, miner_acc, test_core_time::get_time()); DO_CALLBACK(events, "configure_core"); // necessary to set m_hardforks @@ -602,8 +600,6 @@ zarcanum_in_alt_chain::zarcanum_in_alt_chain() bool zarcanum_in_alt_chain::generate(std::vector& events) const { - bool r = false; - uint64_t ts = test_core_time::get_time(); m_accounts.resize(TOTAL_ACCS_COUNT); account_base& miner_acc = m_accounts[MINER_ACC_IDX]; miner_acc.generate(); miner_acc.set_createtime(ts); @@ -750,8 +746,6 @@ bool zarcanum_block_with_txs::generate(std::vector& events) co { // Test idea: make sure Zarcanum PoS block can have txs and the sum of fees is correctly added to the block reward - bool r = false; - uint64_t ts = test_core_time::get_time(); m_accounts.resize(TOTAL_ACCS_COUNT); account_base& miner_acc = m_accounts[MINER_ACC_IDX]; miner_acc.generate(); miner_acc.set_createtime(ts);