mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-07-14 07:59:33 +02:00
8791c4764ctest: use ExtendedPrivateKey in wallet_taproot.py (rkrux)89ceafafb9test: use ExtendedPrivateKey in wallet_listdescriptors.py (rkrux)bbfffcab58test: use ExtendedPrivateKey in wallet_send.py (rkrux)2ab6e590f7test: use ExtendedPrivateKey in wallet_keypool.py (rkrux)9e20118720test: use ExtendedPrivateKey in wallet_fundrawtransaction.py (rkrux)06af0cddbbtest: use ExtendedPrivateKey in wallet_descriptor.py (rkrux)4100fac20etest: use ExtendedPrivateKey in wallet_createwallet.py (rkrux)ff3f6def9atest: use ExtendedPrivateKey in wallet_bumpfee.py (rkrux)003f2a01f6test: use ExtendedPrivateKey in feature_notifications.py (rkrux)f988e6d6e6test: use ExtendedPrivateKey in wallet_importdescriptors.py (rkrux)d2a03d50actest: add extendedkey.py unit tests by using BIP32 test vectors (rkrux)afdb378082test: introduce ExtendedPrivateKey and ExtendedPublicKey classes (rkrux)4dbaa7cc65test: generalise byte_to_base58 utility function to allow more version types (rkrux) Pull request description: Many a times there has been a need to come up with dynamic xprvs and xpubs in the functional tests, but the lack of code that creates them dynamically has led to the presence of several hardcoded keys in the testing framework. This is not developer friendly and not self-documenting, clutters the testing code, and makes it difficult to update the tests in the future. This PR introduces two utility classes ExtendedPrivateKey and ExtendedPublicKey that allows the developer to create them on the fly to be used in the tests. I have intentionally not introduced any library for this purpose and have reused the existing libraries and functions in the framework. The implementation is supposed to provide basic functionality for creating xprv randomly or from a fixed seed, creating corresponding xpub, and deriving child xprvs and xpubs at custom derivation paths. I've updated many tests to show how these can be used, there are more tests as well that can be updated in the future to completely remove such non-deterministic hardcoded keys. ACKs for top commit: achow101: ACK8791c4764cw0xlt: ACK8791c4764cTree-SHA512: f8ec4e09eaa6cc44b0f1c9a91337e570b12fb882c258be89b470de1a8cecf9d2fd40d9f02ee739dcbf639462ea7710aa145a3726f0f537f5a1f1e7772e5b019d