wallet_keypool_topup.py: Test for all keypool address types #14857

pull instagibbs wants to merge 1 commits into bitcoin:master from instagibbs:keypool_topup_addresstype changing 1 files +39 −24
  1. instagibbs commented at 1:22 pm on December 2, 2018: member
    To protect against regressions if key scanning is changed.
  2. fanquake added the label Tests on Dec 2, 2018
  3. in test/functional/wallet_keypool_topup.py:46 in a80edd7e68 outdated
    46-        self.log.info("Generate keys for wallet")
    47-        for _ in range(90):
    48-            addr_oldpool = self.nodes[1].getnewaddress()
    49-        for _ in range(20):
    50-            addr_extpool = self.nodes[1].getnewaddress()
    51+        for i, output_type in enumerate(["legacy" , "p2sh-segwit", "bech32"]):
    


    practicalswift commented at 2:00 pm on December 3, 2018:
    Nit: Drop space before “,” :-)

    instagibbs commented at 5:13 pm on December 3, 2018:
    done
  4. in test/functional/wallet_keypool_topup.py:48 in a80edd7e68 outdated
    54-        self.nodes[0].sendtoaddress(addr_oldpool, 10)
    55-        self.nodes[0].generate(1)
    56-        self.nodes[0].sendtoaddress(addr_extpool, 5)
    57-        self.nodes[0].generate(1)
    58-        sync_blocks(self.nodes)
    59+            self.log.info("Generate keys for wallet with address type: " + output_type)
    


    practicalswift commented at 2:01 pm on December 3, 2018:
    Make this logging lazy by using string format arguments :-)

    instagibbs commented at 5:13 pm on December 3, 2018:
    done
  5. promag commented at 4:01 pm on December 3, 2018: member
    utACK.
  6. in test/functional/wallet_keypool_topup.py:53 in a80edd7e68 outdated
    59+            self.log.info("Generate keys for wallet with address type: " + output_type)
    60+            idx = i+1
    61+            for _ in range(90):
    62+                addr_oldpool = self.nodes[idx].getnewaddress(output_type)
    63+            for _ in range(20):
    64+                addr_extpool = self.nodes[idx].getnewaddress(output_type)
    


    MarcoFalke commented at 4:44 pm on December 3, 2018:
    Why are you passing output_type to be the label of the new address?

    instagibbs commented at 4:51 pm on December 3, 2018:
    because this test isn’t actually testing anything. Thanks. Will fix.

    instagibbs commented at 5:13 pm on December 3, 2018:
    done

    promag commented at 5:13 pm on December 3, 2018:
    wow, should we promote named parameters? IIUC it’s missing -addresstype in L28?

    instagibbs commented at 5:16 pm on December 3, 2018:
    @program learned my lesson and added named params in my fix :)
  7. MarcoFalke dismissed
  8. MarcoFalke commented at 4:48 pm on December 3, 2018: member
    The test is testing nothing
  9. wallet_keypool_topup.py: Test for all keypool address types 0dcac51049
  10. instagibbs force-pushed on Dec 3, 2018
  11. instagibbs commented at 5:14 pm on December 3, 2018: member
    Tested that the returned addresses appear to be the expected type.
  12. MarcoFalke merged this on Dec 11, 2018
  13. MarcoFalke closed this on Dec 11, 2018

  14. MarcoFalke referenced this in commit 7701b62561 on Dec 11, 2018
  15. Munkybooty referenced this in commit 26640f9f56 on Aug 5, 2021
  16. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 12:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me