-
Notifications
You must be signed in to change notification settings - Fork 38.6k
test: Test p2sh-witness and bech32 in wallet_import_rescan #16465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Test p2sh-witness and bech32 in wallet_import_rescan #16465
Conversation
fabad6e to
fabe6fa
Compare
|
Fixed linter by adding the false-positive to a whitelist 😬 |
fabe6fa to
fa2a2ba
Compare
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. Coverage
Updated at: 2019-08-07T11:47:01.569823. |
|
More dead code hits? https://gist.github.com/Sjors/e2704ff54fdc85b2b5833242a1d1e3e3 Tests pass on top of #16301. |
Thanks, was about to test this. |
|
ACK fa2a2bab0ffef281940c5383f2f4528145707ee6 |
|
@Sjors Regarding your posted gist: according to |
jnewbery
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits inline. Also, in commit test: Generate one block for each send in wallet_import_rescan, can you add a motivation to the commit log. I can see what it's doing, but I don't understand why.
This ... * ensures that enough coins are available/spendable, even when more variants are added * ensures that all mempool txs are mined, even when more variants are added * makes the test more specific to test that the confirmation height is properly reported and timestamps are correctly handled in the test logic * prepares the test for a future, where blocks are skipped for rescan if they are deemed irrelevant by a filter (c.f. BIP157)
fa2a2ba to
fa97f2d
Compare
Added a few bullet points why generating a block each makes sense. Thanks for the review @jnewbery. I think I addressed all feedback |
fa97f2d to
fa2db10
Compare
jnewbery
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Couple more comments inline.
fa2db10 to
faea912
Compare
716f00f to
fbf2961
Compare
fbf2961 to
faea626
Compare
faea626 to
fa3c657
Compare
|
Reworked the whitelist, as requested by @jnewbery |
jnewbery
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK fa3c657
| @@ -0,0 +1,45 @@ | |||
| BadInputOutpointIndex # unused class (test/functional/data/invalid_txs.py) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: sort
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is sorted, according to cat ./*whitelist|sort on my system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fascinating:
→ cat test/lint/lint-python-dead-code-whitelist | LC_ALL=en_US.UTF-8 sort
BadInputOutpointIndex # unused class (test/functional/data/invalid_txs.py)
_.carbon_path # unused attribute (contrib/macdeploy/custom_dsstore.py)
connection_lost # unused function (test/functional/test_framework/mininode.py)
connection_made # unused function (test/functional/test_framework/mininode.py)
[...]
→ cat test/lint/lint-python-dead-code-whitelist | LC_ALL=C sort
BadInputOutpointIndex # unused class (test/functional/data/invalid_txs.py)
DuplicateInput # unused class (test/functional/data/invalid_txs.py)
InvalidOPIFConstruction # unused class (test/functional/data/invalid_txs.py)
NonexistentInput # unused class (test/functional/data/invalid_txs.py)
OutputMissing # unused class (test/functional/data/invalid_txs.py)
SizeTooSmall # unused class (test/functional/data/invalid_txs.py)
SpendNegative # unused class (test/functional/data/invalid_txs.py)
SpendTooMuch # unused class (test/functional/data/invalid_txs.py)
TooManySigops # unused class (test/functional/data/invalid_txs.py)
_.carbon_path # unused attribute (contrib/macdeploy/custom_dsstore.py)
_.converter # unused attribute (test/functional/test_framework/test_framework.py)
[...]
fa3c657 lint: Add false positive to python dead code linter (MarcoFalke) fa25668 test: Test p2sh-witness and bech32 in wallet_import_rescan (MarcoFalke) fa79af2 test: Replace fragile "rng" with call to random() (MarcoFalke) fac3dcf test: Generate one block for each send in wallet_import_rescan (MarcoFalke) Pull request description: This adds test coverage for segwit in the `wallet_import_rescan` test, among other cleanups. ACKs for top commit: jnewbery: ACK fa3c657 Tree-SHA512: 877741763c62c1bf9d868864a1e3f0699857e8c028e9fcd65c7eeb73600c22cbe97b7b51093737743d9e87bcb991c1fe1086f673e18765aef0fcfe27951402f0
ryanofsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
post-merge utACK fa3c657. Sorry for not getting to this. I looked a while ago but was thrown off by the first commit, because it seemed to be making the test slower and more complicated for no reason, but it's very well explained now, and in general all the new improvements and suggestions are really nice.
…ort_rescan fa3c657 lint: Add false positive to python dead code linter (MarcoFalke) fa25668 test: Test p2sh-witness and bech32 in wallet_import_rescan (MarcoFalke) fa79af2 test: Replace fragile "rng" with call to random() (MarcoFalke) fac3dcf test: Generate one block for each send in wallet_import_rescan (MarcoFalke) Pull request description: This adds test coverage for segwit in the `wallet_import_rescan` test, among other cleanups. ACKs for top commit: jnewbery: ACK fa3c657 Tree-SHA512: 877741763c62c1bf9d868864a1e3f0699857e8c028e9fcd65c7eeb73600c22cbe97b7b51093737743d9e87bcb991c1fe1086f673e18765aef0fcfe27951402f0
…_import_rescan Summary: This ... * ensures that enough coins are available/spendable, even when more variants are added * ensures that all mempool txs are mined, even when more variants are added * makes the test more specific to test that the confirmation height is properly reported and timestamps are correctly handled in the test logic * prepares the test for a future, where blocks are skipped for rescan if they are deemed irrelevant by a filter (c.f. BIP157) This is a partial backport of Core [[bitcoin/bitcoin#16465 | PR16465]] - part 1 of 3 Commit bitcoin/bitcoin@fac3dcf Test Plan: `ninja && test/functional/test_runner.py wallet_import_rescan.py` Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D8054
Summary: This is a partial backport of Core [[bitcoin/bitcoin#16465 | PR16465]] - part 2 of 3 Commit bitcoin/bitcoin@fa79af2 Depends on D8054 Test Plan: `ninja && test/functional/test_runner.py wallet_import_rescan.py` Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D8055
Summary: The initial commit added tests that are not relevant for us, but also did some minor refactoring that could add more robustness if the tests evolve in the future (remember `extra_args` in `setup_network` in nodes are restarted). The initial commit introduced a bug later fixed in [[bitcoin/bitcoin#16920 | PR16920]]. This fix taken into accound here. This concludes backport of Core [[bitcoin/bitcoin#16465 | PR16465]] - part 3 of 3 Commit bitcoin/bitcoin@fa25668 Depends on D8055 Test Plan: `ninja && test/functional/test_runner.py wallet_import_rescan.py` Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D8056
This adds test coverage for segwit in the
wallet_import_rescantest, among other cleanups.