Skip to content

Commit 38d3d0b

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#24796: lint: misc updates & fixes
f87f259 refactor: fixup named args in txpackage tests (fanquake) 864772c lint: mypy 0.942 (fanquake) 38031ad lint: flake8 4.0.1 (fanquake) eaf712c lint: codespell 2.1.0 (fanquake) Pull request description: Use newer versions of our lint packages. Fix all the outstanding typos. Fix the failing CI. ACKs for top commit: MarcoFalke: review ACK f87f259 Tree-SHA512: 2c1471c13e088d5b9cdd436ebde40180516ae1dd2a2ea4d2f54214762a0712557d899e73c4cfd32992fe45fce6fdba50ba39254f2c79cd5d1180e873a79b9b22
2 parents 323d4c0 + f87f259 commit 38d3d0b

File tree

5 files changed

+34
-34
lines changed

5 files changed

+34
-34
lines changed

ci/lint/04_install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ ${CI_RETRY_EXE} apt-get install -y clang-format-9 python3-pip curl git gawk jq
1111
update-alternatives --install /usr/bin/clang-format clang-format "$(which clang-format-9 )" 100
1212
update-alternatives --install /usr/bin/clang-format-diff clang-format-diff "$(which clang-format-diff-9)" 100
1313

14-
${CI_RETRY_EXE} pip3 install codespell==2.0.0
15-
${CI_RETRY_EXE} pip3 install flake8==3.8.3
16-
${CI_RETRY_EXE} pip3 install mypy==0.910
14+
${CI_RETRY_EXE} pip3 install codespell==2.1.0
15+
${CI_RETRY_EXE} pip3 install flake8==4.0.1
16+
${CI_RETRY_EXE} pip3 install mypy==0.942
1717
${CI_RETRY_EXE} pip3 install pyzmq==22.3.0
1818
${CI_RETRY_EXE} pip3 install vulture==2.3
1919

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ case $host in
361361
esac
362362

363363
if test "$enable_debug" = "yes"; then
364-
dnl If debugging is enabled, and the user hasn't overriden CXXFLAGS, clear
364+
dnl If debugging is enabled, and the user hasn't overridden CXXFLAGS, clear
365365
dnl them, to prevent autoconfs "-g -O2" being added. Otherwise we'd end up
366366
dnl with "-O0 -g3 -g -O2".
367367
if test "$CXXFLAGS_overridden" = "no"; then
@@ -857,7 +857,7 @@ if test "$use_lcov" = "yes"; then
857857
[AC_MSG_ERROR([lcov testing requested but --coverage linker flag does not work])])
858858
AX_CHECK_COMPILE_FLAG([--coverage],[CORE_CXXFLAGS="$CORE_CXXFLAGS --coverage"],
859859
[AC_MSG_ERROR([lcov testing requested but --coverage flag does not work])])
860-
dnl If coverage is enabled, and the user hasn't overriden CXXFLAGS, clear
860+
dnl If coverage is enabled, and the user hasn't overridden CXXFLAGS, clear
861861
dnl them, to prevent autoconfs "-g -O2" being added. Otherwise we'd end up
862862
dnl with "--coverage -Og -O0 -g -O2".
863863
if test "$CXXFLAGS_overridden" = "no"; then

doc/build-openbsd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Run the following as root to install the base dependencies for building.
1111

1212
```bash
1313
pkg_add bash git gmake libevent libtool boost
14-
# Select the newest version of the follow packages:
14+
# Select the newest version of the following packages:
1515
pkg_add autoconf automake python
1616
```
1717

src/test/txpackage_tests.cpp

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -616,17 +616,17 @@ BOOST_FIXTURE_TEST_CASE(package_cpfp_tests, TestChain100Setup)
616616
const CAmount child_value{parent_value - COIN};
617617

618618
Package package_cpfp;
619-
auto mtx_parent = CreateValidMempoolTransaction(/*input_transaction=*/ m_coinbase_txns[0], /*vout=*/ 0,
620-
/*input_height=*/ 0, /*input_signing_key=*/ coinbaseKey,
621-
/*output_destination=*/ parent_spk,
622-
/*output_amount=*/ parent_value, /*submit=*/ false);
619+
auto mtx_parent = CreateValidMempoolTransaction(/*input_transaction=*/m_coinbase_txns[0], /*input_vout=*/0,
620+
/*input_height=*/0, /*input_signing_key=*/coinbaseKey,
621+
/*output_destination=*/parent_spk,
622+
/*output_amount=*/parent_value, /*submit=*/false);
623623
CTransactionRef tx_parent = MakeTransactionRef(mtx_parent);
624624
package_cpfp.push_back(tx_parent);
625625

626-
auto mtx_child = CreateValidMempoolTransaction(/*input_transaction=*/ tx_parent, /*vout=*/ 0,
627-
/*input_height=*/ 101, /*input_signing_key=*/ child_key,
628-
/*output_destination=*/ child_spk,
629-
/*output_amount=*/ child_value, /*submit=*/ false);
626+
auto mtx_child = CreateValidMempoolTransaction(/*input_transaction=*/tx_parent, /*input_vout=*/0,
627+
/*input_height=*/101, /*input_signing_key=*/child_key,
628+
/*output_destination=*/child_spk,
629+
/*output_amount=*/child_value, /*submit=*/false);
630630
CTransactionRef tx_child = MakeTransactionRef(mtx_child);
631631
package_cpfp.push_back(tx_child);
632632

@@ -688,25 +688,25 @@ BOOST_FIXTURE_TEST_CASE(package_cpfp_tests, TestChain100Setup)
688688
// This package just pays 200 satoshis total. This would be enough to pay for the child alone,
689689
// but isn't enough for the entire package to meet the 1sat/vbyte minimum.
690690
Package package_still_too_low;
691-
auto mtx_parent_cheap = CreateValidMempoolTransaction(/*input_transaction=*/ m_coinbase_txns[1], /*vout=*/ 0,
692-
/*input_height=*/ 0, /*input_signing_key=*/ coinbaseKey,
693-
/*output_destination=*/ parent_spk,
694-
/*output_amount=*/ coinbase_value, /*submit=*/ false);
691+
auto mtx_parent_cheap = CreateValidMempoolTransaction(/*input_transaction=*/m_coinbase_txns[1], /*input_vout=*/0,
692+
/*input_height=*/0, /*input_signing_key=*/coinbaseKey,
693+
/*output_destination=*/parent_spk,
694+
/*output_amount=*/coinbase_value, /*submit=*/false);
695695
CTransactionRef tx_parent_cheap = MakeTransactionRef(mtx_parent_cheap);
696696
package_still_too_low.push_back(tx_parent_cheap);
697697

698-
auto mtx_child_cheap = CreateValidMempoolTransaction(/*input_transaction=*/ tx_parent_cheap, /*vout=*/ 0,
699-
/*input_height=*/ 101, /* input_signing_key */ child_key,
700-
/*output_destination=*/ child_spk,
701-
/*output_amount=*/ coinbase_value - 200, /*submit=*/ false);
698+
auto mtx_child_cheap = CreateValidMempoolTransaction(/*input_transaction=*/tx_parent_cheap, /*input_vout=*/0,
699+
/*input_height=*/101, /*input_signing_key=*/child_key,
700+
/*output_destination=*/child_spk,
701+
/*output_amount=*/coinbase_value - 200, /*submit=*/false);
702702
CTransactionRef tx_child_cheap = MakeTransactionRef(mtx_child_cheap);
703703
package_still_too_low.push_back(tx_child_cheap);
704704

705705
// Cheap package should fail with package-fee-too-low.
706706
{
707707
BOOST_CHECK_EQUAL(m_node.mempool->size(), expected_pool_size);
708708
const auto submit_package_too_low = ProcessNewPackage(m_node.chainman->ActiveChainstate(), *m_node.mempool,
709-
package_still_too_low, /* test_accept */ false);
709+
package_still_too_low, /*test_accept=*/false);
710710
BOOST_CHECK_MESSAGE(submit_package_too_low.m_state.IsInvalid(), "Package validation unexpectedly succeeded");
711711
BOOST_CHECK_EQUAL(submit_package_too_low.m_state.GetResult(), PackageValidationResult::PCKG_POLICY);
712712
BOOST_CHECK_EQUAL(submit_package_too_low.m_state.GetRejectReason(), "package-fee-too-low");
@@ -728,7 +728,7 @@ BOOST_FIXTURE_TEST_CASE(package_cpfp_tests, TestChain100Setup)
728728
// Now that the child's fees have "increased" by 1 BTC, the cheap package should succeed.
729729
{
730730
const auto submit_prioritised_package = ProcessNewPackage(m_node.chainman->ActiveChainstate(), *m_node.mempool,
731-
package_still_too_low, /*test_accept=*/ false);
731+
package_still_too_low, /*test_accept=*/false);
732732
expected_pool_size += 2;
733733
BOOST_CHECK_MESSAGE(submit_prioritised_package.m_state.IsValid(),
734734
"Package validation unexpectedly failed" << submit_prioritised_package.m_state.GetRejectReason());
@@ -747,25 +747,25 @@ BOOST_FIXTURE_TEST_CASE(package_cpfp_tests, TestChain100Setup)
747747
// the parent from being accepted.
748748
Package package_rich_parent;
749749
const CAmount high_parent_fee{1 * COIN};
750-
auto mtx_parent_rich = CreateValidMempoolTransaction(/*input_transaction=*/ m_coinbase_txns[2], /*vout=*/ 0,
751-
/*input_height=*/ 0, /*input_signing_key=*/ coinbaseKey,
752-
/*output_destination=*/ parent_spk,
753-
/*output_amount=*/ coinbase_value - high_parent_fee, /*submit=*/ false);
750+
auto mtx_parent_rich = CreateValidMempoolTransaction(/*input_transaction=*/m_coinbase_txns[2], /*input_vout=*/0,
751+
/*input_height=*/0, /*input_signing_key=*/coinbaseKey,
752+
/*output_destination=*/parent_spk,
753+
/*output_amount=*/coinbase_value - high_parent_fee, /*submit=*/false);
754754
CTransactionRef tx_parent_rich = MakeTransactionRef(mtx_parent_rich);
755755
package_rich_parent.push_back(tx_parent_rich);
756756

757-
auto mtx_child_poor = CreateValidMempoolTransaction(/*input_transaction=*/ tx_parent_rich, /*vout=*/ 0,
758-
/*input_height=*/ 101, /*input_signing_key=*/ child_key,
759-
/*output_destination=*/ child_spk,
760-
/*output_amount=*/ coinbase_value - high_parent_fee, /*submit=*/ false);
757+
auto mtx_child_poor = CreateValidMempoolTransaction(/*input_transaction=*/tx_parent_rich, /*input_vout=*/0,
758+
/*input_height=*/101, /*input_signing_key=*/child_key,
759+
/*output_destination=*/child_spk,
760+
/*output_amount=*/coinbase_value - high_parent_fee, /*submit=*/false);
761761
CTransactionRef tx_child_poor = MakeTransactionRef(mtx_child_poor);
762762
package_rich_parent.push_back(tx_child_poor);
763763

764764
// Parent pays 1 BTC and child pays none. The parent should be accepted without the child.
765765
{
766766
BOOST_CHECK_EQUAL(m_node.mempool->size(), expected_pool_size);
767767
const auto submit_rich_parent = ProcessNewPackage(m_node.chainman->ActiveChainstate(), *m_node.mempool,
768-
package_rich_parent, /* test_accept */ false);
768+
package_rich_parent, /*test_accept=*/false);
769769
expected_pool_size += 1;
770770
BOOST_CHECK_MESSAGE(submit_rich_parent.m_state.IsInvalid(), "Package validation unexpectedly succeeded");
771771

src/wallet/coinselection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ struct OutputGroup
225225
[[nodiscard]] CAmount GetSelectionWaste(const std::set<COutput>& inputs, CAmount change_cost, CAmount target, bool use_effective_value = true);
226226

227227

228-
/** Chooose a random change target for each transaction to make it harder to fingerprint the Core
228+
/** Choose a random change target for each transaction to make it harder to fingerprint the Core
229229
* wallet based on the change output values of transactions it creates.
230230
* The random value is between 50ksat and min(2 * payment_value, 1milsat)
231231
* When payment_value <= 25ksat, the value is just 50ksat.

0 commit comments

Comments
 (0)