mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-09 10:43:19 -05:00
Enable clang-tidy bugprone-argument-comment and fix violations
This commit is contained in:
parent
92aad5303b
commit
fa57fa1a2e
9 changed files with 14 additions and 12 deletions
2
src/.clang-tidy
Normal file
2
src/.clang-tidy
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
Checks: '-*,bugprone-argument-comment'
|
||||||
|
WarningsAsErrors: bugprone-argument-comment
|
|
@ -53,7 +53,7 @@ static void CoinSelection(benchmark::Bench& bench)
|
||||||
const CoinSelectionParams coin_selection_params(/* change_output_size= */ 34,
|
const CoinSelectionParams coin_selection_params(/* change_output_size= */ 34,
|
||||||
/* change_spend_size= */ 148, /* effective_feerate= */ CFeeRate(0),
|
/* change_spend_size= */ 148, /* effective_feerate= */ CFeeRate(0),
|
||||||
/* long_term_feerate= */ CFeeRate(0), /* discard_feerate= */ CFeeRate(0),
|
/* long_term_feerate= */ CFeeRate(0), /* discard_feerate= */ CFeeRate(0),
|
||||||
/* tx_no_inputs_size= */ 0, /* avoid_partial= */ false);
|
/* tx_noinputs_size= */ 0, /* avoid_partial= */ false);
|
||||||
bench.run([&] {
|
bench.run([&] {
|
||||||
std::set<CInputCoin> setCoinsRet;
|
std::set<CInputCoin> setCoinsRet;
|
||||||
CAmount nValueRet;
|
CAmount nValueRet;
|
||||||
|
|
|
@ -112,7 +112,7 @@ void TestAddAddressesToSendBook(interfaces::Node& node)
|
||||||
WalletContext& context = *node.walletClient().context();
|
WalletContext& context = *node.walletClient().context();
|
||||||
AddWallet(context, wallet);
|
AddWallet(context, wallet);
|
||||||
WalletModel walletModel(interfaces::MakeWallet(context, wallet), clientModel, platformStyle.get());
|
WalletModel walletModel(interfaces::MakeWallet(context, wallet), clientModel, platformStyle.get());
|
||||||
RemoveWallet(context, wallet, /* load_on_startup= */ std::nullopt);
|
RemoveWallet(context, wallet, /* load_on_start= */ std::nullopt);
|
||||||
EditAddressDialog editAddressDialog(EditAddressDialog::NewSendingAddress);
|
EditAddressDialog editAddressDialog(EditAddressDialog::NewSendingAddress);
|
||||||
editAddressDialog.setModel(walletModel.getAddressTableModel());
|
editAddressDialog.setModel(walletModel.getAddressTableModel());
|
||||||
|
|
||||||
|
|
|
@ -167,7 +167,7 @@ void TestGUI(interfaces::Node& node)
|
||||||
WalletContext& context = *node.walletClient().context();
|
WalletContext& context = *node.walletClient().context();
|
||||||
AddWallet(context, wallet);
|
AddWallet(context, wallet);
|
||||||
WalletModel walletModel(interfaces::MakeWallet(context, wallet), clientModel, platformStyle.get());
|
WalletModel walletModel(interfaces::MakeWallet(context, wallet), clientModel, platformStyle.get());
|
||||||
RemoveWallet(context, wallet, /* load_on_startup= */ std::nullopt);
|
RemoveWallet(context, wallet, /* load_on_start= */ std::nullopt);
|
||||||
sendCoinsDialog.setModel(&walletModel);
|
sendCoinsDialog.setModel(&walletModel);
|
||||||
transactionView.setModel(&walletModel);
|
transactionView.setModel(&walletModel);
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ bool CheckSignetBlockSolution(const CBlock& block, const Consensus::Params& cons
|
||||||
|
|
||||||
PrecomputedTransactionData txdata;
|
PrecomputedTransactionData txdata;
|
||||||
txdata.Init(signet_txs->m_to_sign, {signet_txs->m_to_spend.vout[0]});
|
txdata.Init(signet_txs->m_to_sign, {signet_txs->m_to_spend.vout[0]});
|
||||||
TransactionSignatureChecker sigcheck(&signet_txs->m_to_sign, /*nIn=*/ 0, /*amount=*/ signet_txs->m_to_spend.vout[0].nValue, txdata, MissingDataBehavior::ASSERT_FAIL);
|
TransactionSignatureChecker sigcheck(&signet_txs->m_to_sign, /* nInIn= */ 0, /* amountIn= */ signet_txs->m_to_spend.vout[0].nValue, txdata, MissingDataBehavior::ASSERT_FAIL);
|
||||||
|
|
||||||
if (!VerifyScript(scriptSig, signet_txs->m_to_spend.vout[0].scriptPubKey, &witness, BLOCK_SCRIPT_VERIFY_FLAGS, sigcheck)) {
|
if (!VerifyScript(scriptSig, signet_txs->m_to_spend.vout[0].scriptPubKey, &witness, BLOCK_SCRIPT_VERIFY_FLAGS, sigcheck)) {
|
||||||
LogPrint(BCLog::VALIDATION, "CheckSignetBlockSolution: Errors in block (block solution invalid)\n");
|
LogPrint(BCLog::VALIDATION, "CheckSignetBlockSolution: Errors in block (block solution invalid)\n");
|
||||||
|
|
|
@ -415,7 +415,7 @@ static bool CheckInputsFromMempoolAndCache(const CTransaction& tx, TxValidationS
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call CheckInputScripts() to cache signature and script validity against current tip consensus rules.
|
// Call CheckInputScripts() to cache signature and script validity against current tip consensus rules.
|
||||||
return CheckInputScripts(tx, state, view, flags, /* cacheSigStore = */ true, /* cacheFullSciptStore = */ true, txdata);
|
return CheckInputScripts(tx, state, view, flags, /* cacheSigStore= */ true, /* cacheFullScriptStore= */ true, txdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
|
@ -165,7 +165,7 @@ void UnloadWallets(WalletContext& context)
|
||||||
auto wallet = wallets.back();
|
auto wallet = wallets.back();
|
||||||
wallets.pop_back();
|
wallets.pop_back();
|
||||||
std::vector<bilingual_str> warnings;
|
std::vector<bilingual_str> warnings;
|
||||||
RemoveWallet(context, wallet, /* load_on_startup= */ std::nullopt, warnings);
|
RemoveWallet(context, wallet, /* load_on_start= */ std::nullopt, warnings);
|
||||||
UnloadWallet(std::move(wallet));
|
UnloadWallet(std::move(wallet));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ CoinEligibilityFilter filter_standard_extra(6, 6, 0);
|
||||||
CoinSelectionParams coin_selection_params(/* change_output_size= */ 0,
|
CoinSelectionParams coin_selection_params(/* change_output_size= */ 0,
|
||||||
/* change_spend_size= */ 0, /* effective_feerate= */ CFeeRate(0),
|
/* change_spend_size= */ 0, /* effective_feerate= */ CFeeRate(0),
|
||||||
/* long_term_feerate= */ CFeeRate(0), /* discard_feerate= */ CFeeRate(0),
|
/* long_term_feerate= */ CFeeRate(0), /* discard_feerate= */ CFeeRate(0),
|
||||||
/* tx_no_inputs_size= */ 0, /* avoid_partial= */ false);
|
/* tx_noinputs_size= */ 0, /* avoid_partial= */ false);
|
||||||
|
|
||||||
static void add_coin(const CAmount& nValue, int nInput, std::vector<CInputCoin>& set)
|
static void add_coin(const CAmount& nValue, int nInput, std::vector<CInputCoin>& set)
|
||||||
{
|
{
|
||||||
|
@ -287,7 +287,7 @@ BOOST_AUTO_TEST_CASE(bnb_search_test)
|
||||||
CoinSelectionParams coin_selection_params_bnb(/* change_output_size= */ 0,
|
CoinSelectionParams coin_selection_params_bnb(/* change_output_size= */ 0,
|
||||||
/* change_spend_size= */ 0, /* effective_feerate= */ CFeeRate(3000),
|
/* change_spend_size= */ 0, /* effective_feerate= */ CFeeRate(3000),
|
||||||
/* long_term_feerate= */ CFeeRate(1000), /* discard_feerate= */ CFeeRate(1000),
|
/* long_term_feerate= */ CFeeRate(1000), /* discard_feerate= */ CFeeRate(1000),
|
||||||
/* tx_no_inputs_size= */ 0, /* avoid_partial= */ false);
|
/* tx_noinputs_size= */ 0, /* avoid_partial= */ false);
|
||||||
CoinSet setCoinsRet;
|
CoinSet setCoinsRet;
|
||||||
CAmount nValueRet;
|
CAmount nValueRet;
|
||||||
empty_wallet();
|
empty_wallet();
|
||||||
|
@ -654,7 +654,7 @@ BOOST_AUTO_TEST_CASE(SelectCoins_test)
|
||||||
CoinSelectionParams cs_params(/* change_output_size= */ 34,
|
CoinSelectionParams cs_params(/* change_output_size= */ 34,
|
||||||
/* change_spend_size= */ 148, /* effective_feerate= */ CFeeRate(0),
|
/* change_spend_size= */ 148, /* effective_feerate= */ CFeeRate(0),
|
||||||
/* long_term_feerate= */ CFeeRate(0), /* discard_feerate= */ CFeeRate(0),
|
/* long_term_feerate= */ CFeeRate(0), /* discard_feerate= */ CFeeRate(0),
|
||||||
/* tx_no_inputs_size= */ 0, /* avoid_partial= */ false);
|
/* tx_noinputs_size= */ 0, /* avoid_partial= */ false);
|
||||||
CoinSet out_set;
|
CoinSet out_set;
|
||||||
CAmount out_value = 0;
|
CAmount out_value = 0;
|
||||||
CCoinControl cc;
|
CCoinControl cc;
|
||||||
|
|
|
@ -235,7 +235,7 @@ BOOST_FIXTURE_TEST_CASE(importmulti_rescan, TestChain100Setup)
|
||||||
"downloading and rescanning the relevant blocks (see -reindex and -rescan "
|
"downloading and rescanning the relevant blocks (see -reindex and -rescan "
|
||||||
"options).\"}},{\"success\":true}]",
|
"options).\"}},{\"success\":true}]",
|
||||||
0, oldTip->GetBlockTimeMax(), TIMESTAMP_WINDOW));
|
0, oldTip->GetBlockTimeMax(), TIMESTAMP_WINDOW));
|
||||||
RemoveWallet(context, wallet, /* load_on_startup= */ std::nullopt);
|
RemoveWallet(context, wallet, /* load_on_start= */ std::nullopt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)
|
||||||
request.params.push_back(backup_file);
|
request.params.push_back(backup_file);
|
||||||
|
|
||||||
::dumpwallet().HandleRequest(request);
|
::dumpwallet().HandleRequest(request);
|
||||||
RemoveWallet(context, wallet, /* load_on_startup= */ std::nullopt);
|
RemoveWallet(context, wallet, /* load_on_start= */ std::nullopt);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call importwallet RPC and verify all blocks with timestamps >= BLOCK_TIME
|
// Call importwallet RPC and verify all blocks with timestamps >= BLOCK_TIME
|
||||||
|
@ -299,7 +299,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)
|
||||||
AddWallet(context, wallet);
|
AddWallet(context, wallet);
|
||||||
wallet->SetLastBlockProcessed(m_node.chainman->ActiveChain().Height(), m_node.chainman->ActiveChain().Tip()->GetBlockHash());
|
wallet->SetLastBlockProcessed(m_node.chainman->ActiveChain().Height(), m_node.chainman->ActiveChain().Tip()->GetBlockHash());
|
||||||
::importwallet().HandleRequest(request);
|
::importwallet().HandleRequest(request);
|
||||||
RemoveWallet(context, wallet, /* load_on_startup= */ std::nullopt);
|
RemoveWallet(context, wallet, /* load_on_start= */ std::nullopt);
|
||||||
|
|
||||||
BOOST_CHECK_EQUAL(wallet->mapWallet.size(), 3U);
|
BOOST_CHECK_EQUAL(wallet->mapWallet.size(), 3U);
|
||||||
BOOST_CHECK_EQUAL(m_coinbase_txns.size(), 103U);
|
BOOST_CHECK_EQUAL(m_coinbase_txns.size(), 103U);
|
||||||
|
|
Loading…
Add table
Reference in a new issue