0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-03 09:56:38 -05:00

Merge bitcoin/bitcoin#26894: test: Remove redundant key_to_p2pkh call

61360e0cf9 test: Remove redundant function call (Kolby ML)

Pull request description:

  Removed unnecessary function call and assignment `get_generate_key()` already calls `key_to_p2pkh()` and stores it in the object as p2pkh_addr.

  key.p2pkh_addr is already used for most testcases as well, so it is just a redundant call

ACKs for top commit:
  MarcoFalke:
    ACK 61360e0cf9

Tree-SHA512: d39117310d6630bad7a78c051e683dbfc77b27f6182014557fb900c1adaf5f1e12039c5a6c0ea50e908d4a8688da05f2deae701f12e06086d17dde86ae275ec5
This commit is contained in:
MarcoFalke 2023-01-16 10:23:43 +01:00
commit 53ae1022ea
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -15,7 +15,6 @@ variants.
- `test_address()` is called to call getaddressinfo for an address on node1 - `test_address()` is called to call getaddressinfo for an address on node1
and test the values returned.""" and test the values returned."""
from test_framework.address import key_to_p2pkh
from test_framework.blocktools import COINBASE_MATURITY from test_framework.blocktools import COINBASE_MATURITY
from test_framework.test_framework import BitcoinTestFramework from test_framework.test_framework import BitcoinTestFramework
from test_framework.descriptors import descsum_create from test_framework.descriptors import descsum_create
@ -120,12 +119,11 @@ class ImportDescriptorsTest(BitcoinTestFramework):
self.log.info("Internal addresses should be detected as such") self.log.info("Internal addresses should be detected as such")
key = get_generate_key() key = get_generate_key()
addr = key_to_p2pkh(key.pubkey)
self.test_importdesc({"desc": descsum_create("pkh(" + key.pubkey + ")"), self.test_importdesc({"desc": descsum_create("pkh(" + key.pubkey + ")"),
"timestamp": "now", "timestamp": "now",
"internal": True}, "internal": True},
success=True) success=True)
info = w1.getaddressinfo(addr) info = w1.getaddressinfo(key.p2pkh_addr)
assert_equal(info["ismine"], True) assert_equal(info["ismine"], True)
assert_equal(info["ischange"], True) assert_equal(info["ischange"], True)