test: Replace MiniWallet scan_blocks with rescan_utxos #23017

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2109-testMiniWalletCleanup changing 5 files +7 −14
  1. MarcoFalke commented at 1:24 pm on September 17, 2021: member
    This avoids having to fiddle with the start and num parameters and instead use the scantxoutset RPC functionality via rescan_utxos.
  2. MarcoFalke force-pushed on Sep 17, 2021
  3. fanquake added the label Tests on Sep 17, 2021
  4. theStack commented at 2:36 pm on September 17, 2021: member
    Concept ACK
  5. DrahtBot commented at 1:53 am on September 18, 2021: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #22867 (test: Extend test coverage of BIP125 and document confusing/inconsistent behavior by mjdietzx)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  6. in test/functional/mempool_spend_coinbase.py:38 in fa1b53f2d0 outdated
    37-        utxo_mature = wallet.get_utxo()
    38-        wallet.scan_blocks(start=chain_height - 100 + 2, num=1)
    39-        utxo_immature = wallet.get_utxo()
    40+        coinbase_txid = lambda h: self.nodes[0].getblock(self.nodes[0].getblockhash(chain_height - 100 + h))['tx'][0]
    41+        utxo_mature = wallet.get_utxo(txid=coinbase_txid(1))
    42+        utxo_immature = wallet.get_utxo(txid=coinbase_txid(2))
    


    theStack commented at 10:43 am on September 19, 2021:
    nit, feel free to ignore: For increased readability, I’d rather prefer explicitely passing the absolute heights here, instead of putting magic into the lambda.

    MarcoFalke commented at 6:31 am on September 20, 2021:
    Thanks, done.
  7. theStack approved
  8. theStack commented at 10:46 am on September 19, 2021: member
    ACK fa1b53f2d0532bbfa7982adfecaf84cdb59c8461 🍵
  9. test: Replace MiniWallet scan_blocks with rescan_utxos fa7e3f1fc1
  10. MarcoFalke force-pushed on Sep 20, 2021
  11. theStack approved
  12. theStack commented at 6:58 am on September 20, 2021: member
    re-ACK fa7e3f1fc114056967963a4ad4863a56e406c57e
  13. Shubhankar-Gambhir commented at 8:45 pm on September 20, 2021: contributor

    ACK fa7e3f1, all tests were succesfull

     02021-09-20T20:29:57.177000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_6g5k6jja
     12021-09-20T20:30:17.444000Z TestFramework (INFO): Running test simple doublespend...
     22021-09-20T20:30:17.526000Z TestFramework (INFO): Running test doublespend chain...
     32021-09-20T20:30:18.062000Z TestFramework (INFO): Running test doublespend tree...
     42021-09-20T20:30:21.464000Z TestFramework (INFO): Running test replacement feeperkb...
     52021-09-20T20:30:22.338000Z TestFramework (INFO): Running test spends of conflicting outputs...
     62021-09-20T20:30:24.562000Z TestFramework (INFO): Running test new unconfirmed inputs...
     72021-09-20T20:30:25.733000Z TestFramework (INFO): Running test too many replacements...
     82021-09-20T20:30:27.604000Z TestFramework (INFO): Running test opt-in...
     92021-09-20T20:30:28.917000Z TestFramework (INFO): Running test RPC...
    102021-09-20T20:30:35.362000Z TestFramework (INFO): Running test prioritised transactions...
    112021-09-20T20:30:50.683000Z TestFramework (INFO): Running test no inherited signaling...
    122021-09-20T20:30:50.716000Z TestFramework (INFO): Check that the child tx can still be replaced (via a tx that also replaces the parent)
    132021-09-20T20:30:50.722000Z TestFramework (INFO): Running test replacement relay fee...
    142021-09-20T20:30:50.726000Z TestFramework (INFO): Passed
    152021-09-20T20:30:50.777000Z TestFramework (INFO): Stopping nodes
    162021-09-20T20:30:58.614000Z TestFramework (INFO): Cleaning up /tmp/bitcoin_func_test_6g5k6jja on exit
    172021-09-20T20:30:58.614000Z TestFramework (INFO): Tests successful
    
     02021-09-20T20:11:58.347000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_raz1f_0t
     12021-09-20T20:12:16.412000Z TestFramework (INFO): Add 4 coinbase utxos to the miniwallet
     22021-09-20T20:12:19.429000Z TestFramework (INFO): Create three transactions spending from coinbase utxos: spend_1, spend_2, spend_3
     32021-09-20T20:12:19.438000Z TestFramework (INFO): Create another transaction which is time-locked to two blocks in the future
     42021-09-20T20:12:19.442000Z TestFramework (INFO): Check that the time-locked transaction is too immature to spend
     52021-09-20T20:12:19.655000Z TestFramework (INFO): Broadcast and mine spend_2 and spend_3
     62021-09-20T20:12:19.668000Z TestFramework (INFO): Generate a block
     72021-09-20T20:12:19.674000Z TestFramework (INFO): Check that time-locked transaction is still too immature to spend
     82021-09-20T20:12:19.676000Z TestFramework (INFO): Create spend_2_1 and spend_3_1
     92021-09-20T20:12:19.682000Z TestFramework (INFO): Broadcast and mine spend_3_1
    102021-09-20T20:12:19.685000Z TestFramework (INFO): Generate a block
    112021-09-20T20:12:19.700000Z TestFramework (INFO): The time-locked transaction can now be spent
    122021-09-20T20:12:19.702000Z TestFramework (INFO): Add spend_1 and spend_2_1 to the mempool
    132021-09-20T20:12:20.722000Z TestFramework (INFO): invalidate the last block
    142021-09-20T20:12:20.729000Z TestFramework (INFO): The time-locked transaction is now too immature and has been removed from the mempool
    152021-09-20T20:12:20.730000Z TestFramework (INFO): spend_3_1 has been re-orged out of the chain and is back in the mempool
    162021-09-20T20:12:20.732000Z TestFramework (INFO): Use invalidateblock to re-org back and make all those coinbase spends immature/invalid
    172021-09-20T20:12:20.768000Z TestFramework (INFO): Check that the mempool is empty
    182021-09-20T20:12:20.826000Z TestFramework (INFO): Stopping nodes
    192021-09-20T20:12:26.103000Z TestFramework (INFO): Cleaning up /tmp/bitcoin_func_test_raz1f_0t on exit
    202021-09-20T20:12:26.104000Z TestFramework (INFO): Tests successful
    
    02021-09-20T20:13:25.574000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_hxheqe3j
    12021-09-20T20:13:29.098000Z TestFramework (INFO): Stopping nodes
    22021-09-20T20:13:29.503000Z TestFramework (INFO): Cleaning up /tmp/bitcoin_func_test_hxheqe3j on exit
    32021-09-20T20:13:29.504000Z TestFramework (INFO): Tests successful
    
     02021-09-20T20:15:13.694000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_atozw1v4
     12021-09-20T20:15:20.477000Z TestFramework (INFO): Generate 200 blocks after the genesis block in ten-minute steps
     22021-09-20T20:15:30.242000Z TestFramework (INFO): Test getblockchaininfo
     32021-09-20T20:15:40.739000Z TestFramework (INFO): Test getchaintxstats
     42021-09-20T20:15:40.925000Z TestFramework (INFO): Test gettxoutsetinfo works for blockchain with just the genesis block
     52021-09-20T20:15:41.577000Z TestFramework (INFO): Test gettxoutsetinfo returns the same result after invalidate/reconsider block
     62021-09-20T20:15:42.616000Z TestFramework (INFO): Test gettxoutsetinfo hash_type option
     72021-09-20T20:15:43.059000Z TestFramework (INFO): Test getblockheader
     82021-09-20T20:15:43.071000Z TestFramework (INFO): Test getdifficulty
     92021-09-20T20:15:43.072000Z TestFramework (INFO): Test getnetworkhashps
    102021-09-20T20:15:43.073000Z TestFramework (INFO): Test stopping at height
    112021-09-20T20:15:47.561000Z TestFramework (INFO): Test waitforblockheight
    122021-09-20T20:15:47.937000Z TestFramework (INFO): Test getblock with verbosity 1 doesn't include fee
    132021-09-20T20:15:47.941000Z TestFramework (INFO): Test getblock with verbosity 2 includes expected fee
    142021-09-20T20:15:47.945000Z TestFramework (INFO): Test getblock with verbosity 2 still works with pruned Undo data
    152021-09-20T20:15:47.945000Z TestFramework (INFO): Test getblock with invalid verbosity type returns proper error message
    162021-09-20T20:15:48.059000Z TestFramework (INFO): Stopping nodes
    172021-09-20T20:15:49.418000Z TestFramework (INFO): Cleaning up /tmp/bitcoin_func_test_atozw1v4 on exit
    182021-09-20T20:15:49.418000Z TestFramework (INFO): Tests successful
    
  14. Shubhankar-Gambhir approved
  15. MarcoFalke merged this on Sep 21, 2021
  16. MarcoFalke closed this on Sep 21, 2021

  17. MarcoFalke deleted the branch on Sep 21, 2021
  18. sidhujag referenced this in commit 245e861023 on Sep 21, 2021
  19. DrahtBot locked this on Oct 30, 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-10-04 22:12 UTC

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