Repository navigation
test: use address_to_scriptpubkey instead of RPC call - #27349
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
|
@josibake @theStack @willcl-ark this is PR #27269 follow up, I will appreciate your reviews. |
613d333 to
b4a7a7f
Compare
b4a7a7f to
c73a065
Compare
josibake
left a comment
There was a problem hiding this comment.
ACK c73a065
Nice to see a standard function for getting the scriptPubKey instead of a mix of RPC calls. Removing the RPC call should make the tests run faster, but considering it wasn't used in many places, I doubt it makes a material difference. Left two non-blocking nits.
I also noticed the CI was failing, but when I rebased on master and ran the failing functional test locally, everything passed.
|
@ismaelsadeeq seems ready for review to me |
64d7f54 to
01e0a16
Compare
Ready for review now. |
Thank you for the review Josi |
|
ACK 01e0a16 thanks for taking the suggestions! CI failure seems unrelated from what I can tell 🤷 |
01e0a16 to
02ee904
Compare
theStack
left a comment
There was a problem hiding this comment.
Concept ACK, thanks for following up!
LGTM, left just one small suggestion below.
The COINBASE_MATURITY constant in blocktools.py is imported in wallet.py. However, importing address_to_scriptpubkey to blocktools.py will generate a circular import error. Since the method is related to addresses, it is best to move it to address.py, which will also fix the circular import error. Update imports of address_to_scriptpubkey accordingly.
This commit updates the code by replacing the RPC call used to decode an address and retrieve its corresponding scriptpubkey with the address_to_scriptpubkey function. address_to_scriptpubkey function can now decode all addresses formats, which makes it more efficient to use.
02ee904 to
e47ce42
Compare
|
re-ACK e47ce42 |
Generally good to provide some sort of benchmark/indication of the speedup when talking about performance. |
PR #27269 enables the function address_to_scriptpubkey() to decode all address types and return their corresponding scriptpubkeys. As a result, there is no longer any need to call getaddressinfo or validateaddress RPCs in order to retrieve an address scriptpubkey, as explained in the comments on this pull request (see #27269 (review) and #27269 (comment)).
Instead of using RPC calls, this update replaces the process of obtaining an address scriptPubkey with the address_to_scriptpubkey method, resulting in improved performance for functional tests.