test: run rpc-generateblock.py even with wallet disabled #23558

pull DariusParvin wants to merge 1 commits into bitcoin:master from DariusParvin:rpc-generateblock-to-miniwallet changing 1 files +14 −20
  1. DariusParvin commented at 8:15 pm on November 19, 2021: contributor

    Run rpc_generateblock.py test even when the wallet is disabled, as discussed in #20078.

    This PR picked up from where #20808 left off, started by @nginocchio. Since then, there have been many improvements to MiniWallet, making this PR more straightforward.

    L23 makes use of MiniWallet.rescan_utxos() to add the pre-mined block utxos (when self.setup_clean_chain is not set to True), rather than generating new blocks during the test.

  2. DariusParvin force-pushed on Nov 19, 2021
  3. DrahtBot added the label Tests on Nov 19, 2021
  4. in test/functional/rpc_generateblock.py:27 in 42ae0cdefe outdated
    27 
    28         self.log.info('Generate an empty block to address')
    29-        address = node.getnewaddress()
    30-        hash = self.generateblock(node, output=address, transactions=[])['hash']
    31+        address = miniwallet.get_address()
    32+        hash = node.generateblock(output=address, transactions=[], invalid_call=False)['hash']
    


    MarcoFalke commented at 7:39 am on November 20, 2021:
    This is an invalid call. Can you explain why you are changing this line in the first place?

    DariusParvin commented at 7:53 am on November 20, 2021:
    ah okay I didn’t appreciate the difference I had made. I’ve changed the calls back to how they were before.
  5. DariusParvin force-pushed on Nov 20, 2021
  6. in test/functional/rpc_generateblock.py:27 in f38c11bafe outdated
    27 
    28         self.log.info('Generate an empty block to address')
    29-        address = node.getnewaddress()
    30-        hash = self.generateblock(node, output=address, transactions=[])['hash']
    31+        address = miniwallet.get_address()
    32+        hash = self.generateblock(node, address, [])['hash']
    


    MarcoFalke commented at 7:55 am on November 20, 2021:
    why are the named args removed? Again, why is this line changed at all?

    DariusParvin commented at 7:59 am on November 20, 2021:
    The args were not named on the other calls so I removed it here for consistency too. I’ve added it back so that it’s the same as before.
  7. DariusParvin force-pushed on Nov 20, 2021
  8. MarcoFalke commented at 8:24 am on November 20, 2021: member
    Thanks, Concept ACK.
  9. DariusParvin force-pushed on Nov 20, 2021
  10. test: run rpc-generateblock.py even with wallet disabled 1e86ff7941
  11. DariusParvin force-pushed on Nov 20, 2021
  12. mjdietzx commented at 9:43 pm on November 20, 2021: contributor
    Tested ACK 1e86ff794108d6ef033ceba918b45c5e78c95c62
  13. MarcoFalke merged this on Nov 21, 2021
  14. MarcoFalke closed this on Nov 21, 2021

  15. sidhujag referenced this in commit 8a0f8cdb9c on Nov 21, 2021
  16. sidhujag referenced this in commit 6db7900897 on Nov 23, 2021
  17. DrahtBot locked this on Nov 21, 2022

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-12-23 09:12 UTC

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