Skip to content

Commit f8c17c6

Browse files
MarcoFalkeknst
authored andcommitted
Merge 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
1 parent c5b3773 commit f8c17c6

File tree

4 files changed

+34
-34
lines changed

4 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
@@ -33,10 +33,10 @@ if [ -z "${SKIP_PYTHON_INSTALL}" ]; then
3333
python3 --version
3434
fi
3535

36-
${CI_RETRY_EXE} pip3 install codespell==2.0.0
37-
${CI_RETRY_EXE} pip3 install flake8==3.8.3
36+
${CI_RETRY_EXE} pip3 install codespell==2.1.0
37+
${CI_RETRY_EXE} pip3 install flake8==4.0.1
3838
${CI_RETRY_EXE} pip3 install lief==0.13.1
39-
${CI_RETRY_EXE} pip3 install mypy==0.910
39+
${CI_RETRY_EXE} pip3 install mypy==0.942
4040
${CI_RETRY_EXE} pip3 install pyzmq==22.3.0
4141
${CI_RETRY_EXE} pip3 install vulture==2.3
4242

contrib/containers/ci/ci-slim.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ RUN set -ex; \
6969
# Install Python packages
7070
RUN set -ex; \
7171
pip3 install --no-cache-dir \
72-
codespell==1.17.1 \
73-
flake8==3.8.3 \
72+
codespell==2.1.0 \
73+
flake8==4.0.1 \
7474
jinja2 \
7575
lief==0.13.2 \
7676
multiprocess \
77-
mypy==0.910 \
77+
mypy==0.942 \
7878
pyzmq==22.3.0 \
7979
vulture==2.3
8080

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 gmp 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
git clone https://github.com/dashpay/dash.git

src/test/txpackage_tests.cpp

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

365365
Package package_cpfp;
366-
auto mtx_parent = CreateValidMempoolTransaction(/*input_transaction=*/ m_coinbase_txns[0], /*vout=*/ 0,
367-
/*input_height=*/ 0, /*input_signing_key=*/ coinbaseKey,
368-
/*output_destination=*/ parent_spk,
369-
/*output_amount=*/ parent_value, /*submit=*/ false);
366+
auto mtx_parent = CreateValidMempoolTransaction(/*input_transaction=*/m_coinbase_txns[0], /*input_vout=*/0,
367+
/*input_height=*/0, /*input_signing_key=*/coinbaseKey,
368+
/*output_destination=*/parent_spk,
369+
/*output_amount=*/parent_value, /*submit=*/false);
370370
CTransactionRef tx_parent = MakeTransactionRef(mtx_parent);
371371
package_cpfp.push_back(tx_parent);
372372

373-
auto mtx_child = CreateValidMempoolTransaction(/*input_transaction=*/ tx_parent, /*vout=*/ 0,
374-
/*input_height=*/ 101, /*input_signing_key=*/ child_key,
375-
/*output_destination=*/ child_spk,
376-
/*output_amount=*/ child_value, /*submit=*/ false);
373+
auto mtx_child = CreateValidMempoolTransaction(/*input_transaction=*/tx_parent, /*input_vout=*/0,
374+
/*input_height=*/101, /*input_signing_key=*/child_key,
375+
/*output_destination=*/child_spk,
376+
/*output_amount=*/child_value, /*submit=*/false);
377377
CTransactionRef tx_child = MakeTransactionRef(mtx_child);
378378
package_cpfp.push_back(tx_child);
379379

@@ -435,25 +435,25 @@ BOOST_FIXTURE_TEST_CASE(package_cpfp_tests, TestChain100Setup)
435435
// This package just pays 200 satoshis total. This would be enough to pay for the child alone,
436436
// but isn't enough for the entire package to meet the 1sat/vbyte minimum.
437437
Package package_still_too_low;
438-
auto mtx_parent_cheap = CreateValidMempoolTransaction(/*input_transaction=*/ m_coinbase_txns[1], /*vout=*/ 0,
439-
/*input_height=*/ 0, /*input_signing_key=*/ coinbaseKey,
440-
/*output_destination=*/ parent_spk,
441-
/*output_amount=*/ coinbase_value, /*submit=*/ false);
438+
auto mtx_parent_cheap = CreateValidMempoolTransaction(/*input_transaction=*/m_coinbase_txns[1], /*input_vout=*/0,
439+
/*input_height=*/0, /*input_signing_key=*/coinbaseKey,
440+
/*output_destination=*/parent_spk,
441+
/*output_amount=*/coinbase_value, /*submit=*/false);
442442
CTransactionRef tx_parent_cheap = MakeTransactionRef(mtx_parent_cheap);
443443
package_still_too_low.push_back(tx_parent_cheap);
444444

445-
auto mtx_child_cheap = CreateValidMempoolTransaction(/*input_transaction=*/ tx_parent_cheap, /*vout=*/ 0,
446-
/*input_height=*/ 101, /* input_signing_key */ child_key,
447-
/*output_destination=*/ child_spk,
448-
/*output_amount=*/ coinbase_value - 200, /*submit=*/ false);
445+
auto mtx_child_cheap = CreateValidMempoolTransaction(/*input_transaction=*/tx_parent_cheap, /*input_vout=*/0,
446+
/*input_height=*/101, /*input_signing_key=*/child_key,
447+
/*output_destination=*/child_spk,
448+
/*output_amount=*/coinbase_value - 200, /*submit=*/false);
449449
CTransactionRef tx_child_cheap = MakeTransactionRef(mtx_child_cheap);
450450
package_still_too_low.push_back(tx_child_cheap);
451451

452452
// Cheap package should fail with package-fee-too-low.
453453
{
454454
BOOST_CHECK_EQUAL(m_node.mempool->size(), expected_pool_size);
455455
const auto submit_package_too_low = ProcessNewPackage(m_node.chainman->ActiveChainstate(), *m_node.mempool,
456-
package_still_too_low, /* test_accept */ false);
456+
package_still_too_low, /*test_accept=*/false);
457457
BOOST_CHECK_MESSAGE(submit_package_too_low.m_state.IsInvalid(), "Package validation unexpectedly succeeded");
458458
BOOST_CHECK_EQUAL(submit_package_too_low.m_state.GetResult(), PackageValidationResult::PCKG_POLICY);
459459
BOOST_CHECK_EQUAL(submit_package_too_low.m_state.GetRejectReason(), "package-fee-too-low");
@@ -475,7 +475,7 @@ BOOST_FIXTURE_TEST_CASE(package_cpfp_tests, TestChain100Setup)
475475
// Now that the child's fees have "increased" by 1 BTC, the cheap package should succeed.
476476
{
477477
const auto submit_prioritised_package = ProcessNewPackage(m_node.chainman->ActiveChainstate(), *m_node.mempool,
478-
package_still_too_low, /*test_accept=*/ false);
478+
package_still_too_low, /*test_accept=*/false);
479479
expected_pool_size += 2;
480480
BOOST_CHECK_MESSAGE(submit_prioritised_package.m_state.IsValid(),
481481
"Package validation unexpectedly failed" << submit_prioritised_package.m_state.GetRejectReason());
@@ -494,25 +494,25 @@ BOOST_FIXTURE_TEST_CASE(package_cpfp_tests, TestChain100Setup)
494494
// the parent from being accepted.
495495
Package package_rich_parent;
496496
const CAmount high_parent_fee{1 * COIN};
497-
auto mtx_parent_rich = CreateValidMempoolTransaction(/*input_transaction=*/ m_coinbase_txns[2], /*vout=*/ 0,
498-
/*input_height=*/ 0, /*input_signing_key=*/ coinbaseKey,
499-
/*output_destination=*/ parent_spk,
500-
/*output_amount=*/ coinbase_value - high_parent_fee, /*submit=*/ false);
497+
auto mtx_parent_rich = CreateValidMempoolTransaction(/*input_transaction=*/m_coinbase_txns[2], /*input_vout=*/0,
498+
/*input_height=*/0, /*input_signing_key=*/coinbaseKey,
499+
/*output_destination=*/parent_spk,
500+
/*output_amount=*/coinbase_value - high_parent_fee, /*submit=*/false);
501501
CTransactionRef tx_parent_rich = MakeTransactionRef(mtx_parent_rich);
502502
package_rich_parent.push_back(tx_parent_rich);
503503

504-
auto mtx_child_poor = CreateValidMempoolTransaction(/*input_transaction=*/ tx_parent_rich, /*vout=*/ 0,
505-
/*input_height=*/ 101, /*input_signing_key=*/ child_key,
506-
/*output_destination=*/ child_spk,
507-
/*output_amount=*/ coinbase_value - high_parent_fee, /*submit=*/ false);
504+
auto mtx_child_poor = CreateValidMempoolTransaction(/*input_transaction=*/tx_parent_rich, /*input_vout=*/0,
505+
/*input_height=*/101, /*input_signing_key=*/child_key,
506+
/*output_destination=*/child_spk,
507+
/*output_amount=*/coinbase_value - high_parent_fee, /*submit=*/false);
508508
CTransactionRef tx_child_poor = MakeTransactionRef(mtx_child_poor);
509509
package_rich_parent.push_back(tx_child_poor);
510510

511511
// Parent pays 1 BTC and child pays none. The parent should be accepted without the child.
512512
{
513513
BOOST_CHECK_EQUAL(m_node.mempool->size(), expected_pool_size);
514514
const auto submit_rich_parent = ProcessNewPackage(m_node.chainman->ActiveChainstate(), *m_node.mempool,
515-
package_rich_parent, /* test_accept */ false);
515+
package_rich_parent, /*test_accept=*/false);
516516
expected_pool_size += 1;
517517
BOOST_CHECK_MESSAGE(submit_rich_parent.m_state.IsInvalid(), "Package validation unexpectedly succeeded");
518518

0 commit comments

Comments
 (0)