Deprecate wallet generate RPC method #14299

issue jnewbery openend this issue on September 23, 2018
  1. jnewbery commented at 1:42 pm on September 23, 2018: member

    The generate RPC method:

    • was introduced in 2010
    • is now only used for testing
    • reaches across multiple components (wallet, mining)

    I propose we remove the wallet generate RPC method and update all tests to use the generatetoaddress RPC method. We can do this non-invasively in the test framework by adding a generate method to TestNode so that the individual tests do not need to be updated. We could also add a generate alias to the generatetoaddress RPC method.

    Doing this removes a wallet->server dependency and simplifies the wallet->server interface (#10973).

    I’m opening this issue before implementing in case anyone has objections.

  2. fanquake added the label Tests on Sep 23, 2018
  3. fanquake added the label RPC/REST/ZMQ on Sep 23, 2018
  4. sipa commented at 4:12 pm on September 23, 2018: member
    Sounds great to me.
  5. promag commented at 5:30 pm on September 23, 2018: member
    ACK. Deprecate in 0.18, remove in 0.19?
  6. MarcoFalke commented at 8:54 pm on September 24, 2018: member

    We can do this non-invasively in the test framework by adding a generate method to TestNode so that the individual tests do not need to be updated.

    I have no objections when done this way.

  7. jnewbery commented at 9:56 pm on September 24, 2018: member
    Thanks for the input! @laanwj - any thoughts on this? I suppose some people use generate for manual testing, but that can easily be replaced by something like bitcoin-cli generatetoaddress 1 $(bitcoin-cli getnewaddress)
  8. fanquake added this to the milestone 0.18.0 on Oct 13, 2018
  9. laanwj commented at 10:16 am on October 16, 2018: member
    if the existence of the method is a problem architecturally I’m not opposed to removing it, it’s “only” a testing method so it should affect less users than the other deprecations
  10. promag commented at 10:24 am on October 16, 2018: member

    We could also add a generate alias to the generatetoaddress RPC method. @jnewbery you mean an alias on the server? that would make it depend on the wallet?

  11. laanwj commented at 10:45 am on October 16, 2018: member

    nah, if you’re going to change the API anyway, might as well really deprecate it, adding an alias to a different command probably just adds confusion

    the workaround is good enough:

    0bitcoin-cli generatetoaddress 1 $(bitcoin-cli getnewaddress)
    
  12. laanwj commented at 11:15 am on October 16, 2018: member

    was introduced in 2010

    FYI (not a comment on this issue), generate was introduced in 2015 in #5957, not in 2010. Before that time there were setgenerate and friends

  13. MarcoFalke closed this on Oct 23, 2018

  14. MarcoFalke referenced this in commit 3668bb335c on Oct 23, 2018
  15. Tibo-lg referenced this in commit dc78269ba7 on Aug 20, 2019
  16. Tibo-lg referenced this in commit 87f696bf50 on Aug 28, 2019
  17. DrahtBot locked this on Sep 8, 2021
  18. vijaydasmp referenced this in commit a0a946a221 on Sep 22, 2021
  19. vijaydasmp referenced this in commit 54c6fe8731 on Sep 24, 2021
  20. vijaydasmp referenced this in commit 4ac25a1ba3 on Sep 24, 2021
  21. vijaydasmp referenced this in commit 64277389d6 on Sep 25, 2021
  22. vijaydasmp referenced this in commit eda797313e on Sep 25, 2021
  23. vijaydasmp referenced this in commit f4c1030c51 on Sep 27, 2021
  24. UdjinM6 referenced this in commit e4f621fd57 on May 1, 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-11-17 12:12 UTC

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