refactor: Add ChainClient setMockTime, getWallets methods #17999

pull ryanofsky wants to merge 2 commits into bitcoin:master from ryanofsky:pr/ipc-clients changing 6 files +31 −7
  1. ryanofsky commented at 10:29 pm on January 24, 2020: member

    This PR is part of the process separation project.

    These changes are needed to set mock times, and get wallet interface pointers correctly when wallet code is running in a different process from node code in #10102

  2. fanquake added the label Refactoring on Jan 24, 2020
  3. MarcoFalke commented at 4:48 pm on January 25, 2020: member
    re-run ci
  4. MarcoFalke closed this on Jan 25, 2020

  5. MarcoFalke reopened this on Jan 25, 2020

  6. in src/interfaces/chain.h:290 in a24758246f outdated
    281@@ -280,6 +282,12 @@ class ChainClient
    282 
    283     //! Shut down client.
    284     virtual void stop() = 0;
    285+
    286+    //! Set mock time.
    287+    virtual void setMockTime(int64_t time) = 0;
    288+
    289+    //! Return interfaces for accessing wallets (if any).
    290+    virtual std::vector<std::unique_ptr<Wallet>> getWallets() { return {}; }
    


    promag commented at 4:56 pm on January 27, 2020:
    Any reason to have definition?

    MarcoFalke commented at 6:29 pm on January 30, 2020:
    I presume this is needed when there is more than one chain client that has wallets. Maybe the doc string could be clarified to say “of the wallets of all chain clients” or similar.

    ryanofsky commented at 8:03 pm on February 25, 2020:

    Any reason to have definition?

    No, I think something must have prompted me to add the definition at some point, but I can’t think of what that would have been. Removed definition now (thanks)

  7. promag commented at 4:58 pm on January 27, 2020: member
    Code review ACK, but could squash and avoid the temporary circular dependency.
  8. MarcoFalke approved
  9. MarcoFalke commented at 6:29 pm on January 30, 2020: member

    ACK 06edeb442971747634d1558130d15e6227325422 🚻

    Signature:

     0-----BEGIN PGP SIGNED MESSAGE-----
     1Hash: SHA512
     2
     3ACK 06edeb442971747634d1558130d15e6227325422 🚻
     4-----BEGIN PGP SIGNATURE-----
     5
     6iQGyBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
     7pUhEFQvzBP27AqgANDYm0anOBCrcFhiEuALQa0nLCp7dkxK34mOqJEWsfzYBjKL8
     8kdPgbcyOMx9cc0N1YzQJuVUgFsDEzQjv4+SSogMmec00FEIUPl6rJpVMnmeMbsju
     9+5nmilRKRgZ0TR1Z2dAebe84Cm8go5Il6Il1vI0WcsIE4RzrNVMFAqaVAI/RV+4g
    10EpOzYCwzEgXMGWw4nixku/hrIVRbAlOTsKrOncYmp10/BtDvT4EhJq7D1w1q67KV
    11HDgd5PVa8geRmy7DTEvEjpQEYnL2qBR2yr1WtMwzxWBSGrwqSLCfl7RyQuWgX/2x
    12oMnQzoCszSO9gQM1X7BIag8io0H+hrTgo4OTkWmKxwJHuUX3A8JXTksAPyvw5CSR
    13CM2bxOZUu6hmdrTCrMWHZTbuexn2AQsEFicIWzlP3Kbi/FQXSC7dmx013KHUSmEj
    14K1Fg9FZCBvCJq6nO7Eg4MK5qhYDFzWmTkxPWa10zVNc3/Cto4AWPIJnl9AjjkX8o
    15u+ofy1Y=
    16=OnjJ
    17-----END PGP SIGNATURE-----
    

    Timestamp of file with hash 7dc65ddc41d7a97c1cc5b926e0f20c04316b6c5b18b17537c4fc59c620d2d263 -

  10. Add ChainClient setMockTime, getWallets methods
    Needed to set mock times, and get wallet interface pointers correctly when
    wallet code is running in a different process from node code.
    1dde238f2c
  11. refactor: Use psbt forward declaration
    Also clean up forward other forward declarations in interfaces/wallet.h with !sort
    
    Original motivation for this change was to fix a circular dependencies lint
    error: "interfaces/chain.h -> interfaces/wallet.h -> psbt -> node/transaction
    -> node/context -> interfaces/chain.h" from an earlier commit in this PR adding
    a "interfaces/chain.h -> interfaces/wallet.h" include. Now, the wallet include
    is no longer added, but it is still good to clean up the psbt include for
    efficiency, and to sort the forward declarations.
    3ce16ad2f9
  12. ryanofsky force-pushed on Feb 25, 2020
  13. ryanofsky commented at 9:14 pm on February 25, 2020: member
    Rebased 06edeb442971747634d1558130d15e6227325422 -> 3ce16ad2f91d1e2edc7e7bdc5a19f72aa8c3e739 (pr/ipc-clients.1 -> pr/ipc-clients.2, compare) due to conflict with #18037 and removed extraneous include and method definition.
  14. promag commented at 10:10 pm on February 25, 2020: member
    Code review ACK 3ce16ad2f91d1e2edc7e7bdc5a19f72aa8c3e739.
  15. MarcoFalke commented at 2:55 pm on February 26, 2020: member

    re-ACK 3ce16ad2f91d1e2edc7e7bdc5a19f72aa8c3e739 🔙

    Signature:

     0-----BEGIN PGP SIGNED MESSAGE-----
     1Hash: SHA512
     2
     3re-ACK 3ce16ad2f91d1e2edc7e7bdc5a19f72aa8c3e739 🔙
     4-----BEGIN PGP SIGNATURE-----
     5
     6iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
     7pUguhwv+OeT+gPBC/ph0lphxilHyBJqekSTWMBNvVtlusfJujyxbuCxlv0okK1IS
     83lFhGkeEfEj2/s2H8RMsvDVSjK5BN4/06SHYb99I9POCyjqkeg+grYfUjcqVnNmq
     9U5pPpngZln9OpRd3AMdU7caw8uXcX4l5wak/tYVZRE9QKybF3xPlpHzcpRkdVYnv
    10ZKXSwaGW5gcsUMstlUzzHq1J59XZAk5hHrH3tvi/JcOZPQFD6McKStlTXDXAERBa
    11Fp4cA4K+dn9HkJegMCDw4BSp1bt9oVJXvQshargnDfaYtRQgFDq55O/rtSVJYF4v
    12Ey9o2l8tzbVGz9VABXueSC0mDRz/cN8raO/V50O1guzK5tNlDGJuvRU9VrXWgyR+
    13xPeStH4sJQLzSiuy6aX/7FNIqkPPHk88l14KWLNPyv+T6+YyXWQdTDQF73DlkRQq
    14y2oZ5h0zmOdBZTlwbD21hVQpejDcyFYI9AIihfJzDWjPgN2NWl6ia57Uh08hCX+z
    15M1cZESy9
    16=Ly4W
    17-----END PGP SIGNATURE-----
    

    Timestamp of file with hash d3df18e203f28d9eaeee0acf457efa8312dc6a5a45c7a803a6b0ac74106c450d -

  16. ryanofsky added this to the "In progress" column in a project

  17. DrahtBot commented at 9:10 am on March 30, 2020: member

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

    Conflicts

    No conflicts as of last run.

  18. MarcoFalke merged this on Apr 10, 2020
  19. MarcoFalke closed this on Apr 10, 2020

  20. ryanofsky moved this from the "In progress" to the "Done" column in a project

  21. sidhujag referenced this in commit cb75c3b555 on Apr 13, 2020
  22. jasonbcox referenced this in commit a4ab5f79f2 on Oct 16, 2020
  23. jasonbcox referenced this in commit f89036cf9d on Oct 16, 2020
  24. PhotoshiNakamoto referenced this in commit bb233e8ba6 on Dec 11, 2021
  25. 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-11-21 21:12 UTC

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