I encountered difficulties with the test framework in #17977. This fixes them, and I think the change is generally useful.
[TESTS] Move base58 to own module to break circular dependency #19230
pull sipa wants to merge 1 commits into bitcoin:master from sipa:202006_addr_base58 changing 4 files +74 −71-
sipa commented at 12:52 AM on June 10, 2020: member
-
c75de5da5f
[TESTS] Move base58 to own module to break circular dependency
This breaks the script->key->address->script dependency cycle.
- fanquake added the label Tests on Jun 10, 2020
-
DrahtBot commented at 1:16 AM on June 10, 2020: member
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #17977 ([WIP] Implement BIP 340-342 validation (Schnorr/taproot/tapscript) by sipa)
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.
-
MarcoFalke commented at 11:00 AM on June 10, 2020: member
cc @jnewbery
-
laanwj commented at 12:56 PM on June 10, 2020: member
Code review ACK c75de5da5fdd3a304f9da3d8a2e0370d1723ddd0
and I think the change is generally useful.
I think it makes conceptual sense as well now that base58 is only one of the address formats.
-
MarcoFalke commented at 2:23 PM on June 10, 2020: member
ACK c75de5da5fdd3a304f9da3d8a2e0370d1723ddd0 according to --color-moved=dimmed-zebra this is a move-only apart from the imports 👒
<details><summary>Show signature and timestamp</summary>
Signature:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 ACK c75de5da5fdd3a304f9da3d8a2e0370d1723ddd0 according to --color-moved=dimmed-zebra this is a move-only apart from the imports 👒 -----BEGIN PGP SIGNATURE----- iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p pUi9JQv9GtzM9DRsgO0BnO8JJfq58H6VDVwSvMuM1ZSKO1r7uB4F23/h1YYl0U16 Z3EV2I/YzYetLn2Bj+LwqOcQcJWE3cOqb8VxlRud4fLCjm48kssjos8W4eYA2tzY IjzKnEOUEoq4dXatYOwmNMfnnoPBWR3RnItmTFqP6TkAQFViV11ltr+NbBzMET8I w1zhkhOtGvPcxry2pcWeFVzo414DP6NfpPjiwQxYKI9JAzf+DxAIbJYZ2WlWjVRs docESMvjbHvKmAP7oM2mZq5wJ231d3pRIC8/T+mbODmdclVjdjkUjz6sq2WcAG9x xjJNoHNUClrP3bLOl5y7q5x+u5r/Z4GfoKT/+T1W8jIssReS8f5OK2QSyYZ6GQDh 9+ra2QB/vwkUU/Hqv2hCNveIqO+zuP86Zrgyeusphy6WM4IJrh7WZ/JZCVnrKvXd DiKnSO/rSgL4ZrlW4gzcs7cfnhSGfuC29GWtA53aTuzDT5U86dNqM+rr3SGrtGAc 1UlcEIKi =/Rus -----END PGP SIGNATURE-----Timestamp of file with hash
99fa2b205d75124baf7f30ed5ab5d28755a747c6e20eb143e6144df69ddfbd09 -</details>
- MarcoFalke merged this on Jun 10, 2020
- MarcoFalke closed this on Jun 10, 2020
-
jnewbery commented at 2:50 PM on June 10, 2020: member
What was the circular dependency that this was fixing?
-
jnewbery commented at 3:34 PM on June 10, 2020: member
Concept NACK. This just seems to be moving code around for no good reason. base58 is very much linked to legacy P2PKH and P2SH addresses, so it makes sense that the code for those things should live in the same module (see segwit_address.py where the bech32 and segwit v0 address code are in the same module). The only thing that imports base58 for any other reason are the
bytes_to_wif()andgenerate_wif_key(). Those absolutely shouldn't be in key.py and I have no idea why they were put in a crypo module that previously had no imports. -
jnewbery commented at 4:52 PM on June 10, 2020: member
The circular dependency was script->key->address->script
script doesn't import key
-
sipa commented at 4:54 PM on June 10, 2020: member
Hmm! Perhaps that was fixed then. I wrote this a few months ago, and was annoyed about keeping to rebase it, so I PRed it separately.
-
jnewbery commented at 4:56 PM on June 10, 2020: member
I don't think script has ever imported key in master. It does in your branch, but that doesn't seem like a good reason to open a PR against master
-
sipa commented at 4:57 PM on June 10, 2020: member
Oops, I see.
Still, I think this is generally an improvement.
-
jnewbery commented at 5:07 PM on June 10, 2020: member
I'm simply giving you the feedback that I'd give any other contributor, including someone new to the project: moving the code around for no discernible benefit isn't a good use of reviewer resource.
I'm neutral on whether base58 should have its own module. The bech32 code seems to be perfectly happy in segwit_address.py and I don't see this as any different. I do think it's disappointing that his got two ACKs and was merged within 12 hours even though the motivation and commit log were wrong.
- sidhujag referenced this in commit 13869fcaee on Jun 10, 2020
- Fabcien referenced this in commit 466aa70881 on Aug 25, 2021
- DrahtBot locked this on Feb 15, 2022