test: run mempool_resurrect.py even with wallet disabled #20692

pull mjdietzx wants to merge 1 commits into bitcoin:master from mjdietzx:mempool-resurrect-to-miniwallet changing 1 files +27 −34
  1. mjdietzx commented at 9:03 pm on December 17, 2020: contributor

    Another functional test rewritten as proposed in #20078

    Request for help: node.gettransaction(txid) fails for transactions sent with wallet.send_self_transfer. Even though the txids look correct, are added to the mempool correctly, and removed from the mempool when a block is mined - all as expected.

    However, node.gettransaction(txid) throws the error:

     0Traceback (most recent call last):
     1  File "/Users/michaeldietz/Documents/bitcoin/test/functional/test_framework/test_framework.py", line 126, in main
     2    self.run_test()
     3  File "/Users/michaeldietz/Documents/bitcoin/test/functional/mempool_resurrect.py", line 43, in run_test
     4    assert_equal(len(list(filter(lambda txid: node.gettransaction(txid)["confirmations"] > 0, spends_ids))), len(spends_ids))
     5  File "/Users/michaeldietz/Documents/bitcoin/test/functional/mempool_resurrect.py", line 43, in <lambda>
     6    assert_equal(len(list(filter(lambda txid: node.gettransaction(txid)["confirmations"] > 0, spends_ids))), len(spends_ids))
     7  File "/Users/michaeldietz/Documents/bitcoin/test/functional/test_framework/coverage.py", line 47, in __call__
     8    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
     9  File "/Users/michaeldietz/Documents/bitcoin/test/functional/test_framework/authproxy.py", line 146, in __call__
    10    raise JSONRPCException(response['error'], status)
    11test_framework.authproxy.JSONRPCException: Invalid or non-wallet transaction id (-5)
    

    Anyone know what’s going wrong / can point me in the right direction if I’m making a mistake, or MiniWallet needs to be improved for this to work correctly?

  2. DrahtBot added the label Tests on Dec 17, 2020
  3. lontivero commented at 10:58 pm on December 17, 2020: contributor
    gettransaction is for wallet transactions and the node doesn’t know anything about MiniWallet.
  4. mjdietzx commented at 0:24 am on December 18, 2020: contributor

    gettransaction is for wallet transactions and the node doesn’t know anything about MiniWallet.

    Really? What about here: https://github.com/bitcoin/bitcoin/blob/master/test/functional/test_framework/wallet.py#L74

    The transactions are definitely in the node’s mempool (ie here: https://github.com/bitcoin/bitcoin/blob/master/test/functional/test_framework/wallet.py#L76)

  5. lontivero commented at 1:06 am on December 18, 2020: contributor
    MiniWallet is not a wallet handled by the node, it is an “external” wallet coded in python for testing. gettransaction only works for those wallets handled by the node, that’s why the error says: non-wallet transaction id
  6. mjdietzx force-pushed on Dec 18, 2020
  7. mjdietzx commented at 3:32 am on December 18, 2020: contributor

    MiniWallet is not a wallet handled by the node, it is an “external” wallet coded in python for testing. gettransaction only works for those wallets handled by the node, that’s why the error says: non-wallet transaction id

    Ah I got it - thanks for the explanation. I fixed and pushed/rebased

  8. test: run mempool_resurrect.py even with wallet disabled 11a32722f0
  9. mjdietzx force-pushed on Dec 18, 2020
  10. lontivero commented at 1:25 pm on December 21, 2020: contributor
    ACK. Good job.
  11. MarcoFalke commented at 2:23 pm on December 21, 2020: member
    ACK 11a32722f09f1d81f34bd09b26248ba99f2e7f07
  12. MarcoFalke merged this on Dec 21, 2020
  13. MarcoFalke closed this on Dec 21, 2020

  14. in test/functional/mempool_resurrect.py:55 in 11a32722f0
    80-            assert tx["confirmations"] == 0
    81+        assert_equal(set(node.getrawmempool()), spends_ids)
    82 
    83         # Generate another block, they should all get mined
    84-        self.nodes[0].generate(1)
    85+        node.generate(1)
    


    MarcoFalke commented at 2:35 pm on December 21, 2020:

    Ah, missed this

    blocks needs to be assigned here. See #20737


    mjdietzx commented at 4:04 pm on December 21, 2020:
    Great catch 👀
  15. sidhujag referenced this in commit 0d702e3bdb on Dec 21, 2020
  16. DrahtBot locked this on Feb 15, 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