New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
interfaces: Describe and follow some code conventions #18278
Conversation
Concept ACK. |
671f390
to
2427e93
Compare
Concept ACK On behalf of the eternal stream of future generations of Bitcoin Core developers: thank you for cleaning up the code base :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review ACK 2427e93.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
Rebased 2427e93 -> 60ae4c0 ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 60ae4c0.
It seems AppVeyor fail is unrelated to this PR changes.
@@ -204,7 +204,7 @@ class Node | |||
virtual std::unique_ptr<Wallet> loadWallet(const std::string& name, std::string& error, std::vector<std::string>& warnings) = 0; | |||
|
|||
//! Create a wallet from file | |||
virtual WalletCreationStatus createWallet(const SecureString& passphrase, uint64_t wallet_creation_flags, const std::string& name, std::string& error, std::vector<std::string>& warnings, std::unique_ptr<Wallet>& result) = 0; | |||
virtual std::unique_ptr<Wallet> createWallet(const SecureString& passphrase, uint64_t wallet_creation_flags, const std::string& name, std::string& error, std::vector<std::string>& warnings, WalletCreationStatus& status) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: considering a new signature of the refactored function could a more appropriate semantically name be chosen?
newWallet
or smth similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: #18278 (comment)
nit: considering a new signature of the refactored function could a more appropriate semantically name be chosen?
newWallet
or smth similar?
Unclear why that name is more semantically appropriate, but not knowing this, it seems reasonable for the interface wrapper method name to have the same name as the function it is wrapping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for review
Updated 60ae4c0 -> 43c3b39 (pr/ipc-conv.4
-> pr/ipc-conv.5
, compare) adding suggested wrapping
@@ -204,7 +204,7 @@ class Node | |||
virtual std::unique_ptr<Wallet> loadWallet(const std::string& name, std::string& error, std::vector<std::string>& warnings) = 0; | |||
|
|||
//! Create a wallet from file | |||
virtual WalletCreationStatus createWallet(const SecureString& passphrase, uint64_t wallet_creation_flags, const std::string& name, std::string& error, std::vector<std::string>& warnings, std::unique_ptr<Wallet>& result) = 0; | |||
virtual std::unique_ptr<Wallet> createWallet(const SecureString& passphrase, uint64_t wallet_creation_flags, const std::string& name, std::string& error, std::vector<std::string>& warnings, WalletCreationStatus& status) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: #18278 (comment)
nit: considering a new signature of the refactored function could a more appropriate semantically name be chosen?
newWallet
or smth similar?
Unclear why that name is more semantically appropriate, but not knowing this, it seems reasonable for the interface wrapper method name to have the same name as the function it is wrapping
Rebased 43c3b39 -> 25f1a84 ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-ACK 25f1a84
Replace by privateKeysDisabled method to avoid need for GUI to reference internal wallet flags. Also remove adjacent WalletModel canGetAddresses wrapper that serves no purpose and make Wallet::canGetAddresses non-const so it can be implemented by IPC classes in bitcoin#10102.
Avoid overloading method name to work more easily with IPC framework
…ther interfaces methods This also simplifies bitcoin#10102 removing overrides needed to deal with inconsistent case convention
Make output argument last argument so it works more easily with IPC framework in bitcoin#10102, and for consistency with other methods
Move output arguments after input arguments for consistency with other methods, and to work more easily with IPC framework in bitcoin#10102
Rebased 25f1a84 -> 3dc27a1 ( |
ACK 3dc27a1 🕍 Show signature and timestampSignature:
Timestamp of file with hash |
…tions 3dc27a1 doc: Add internal interface conventions to developer notes (Russell Yanofsky) 1dca9dc refactor: Change createWallet, fillPSBT argument order (Russell Yanofsky) 96dfe5c refactor: Change Chain::broadcastTransaction param order (Russell Yanofsky) 6ceb219 refactor: Rename Chain::Notifications methods to be consistent with other interfaces methods (Russell Yanofsky) 1c2ab1a refactor: Rename Node::disconnect methods (Russell Yanofsky) 77e4b06 refactor: Get rid of Wallet::IsWalletFlagSet method (Russell Yanofsky) Pull request description: This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). This PR doesn't change behavior at all, it just cleans up code in [`src/interfaces`](https://github.com/bitcoin/bitcoin/tree/master/src/interfaces) to simplify bitcoin#10102, and [documents](https://github.com/ryanofsky/bitcoin/blob/pr/ipc-conv/doc/developer-notes.md#internal-interface-guidelines) coding conventions there better ACKs for top commit: hebasto: re-ACK 3dc27a1, the only change since the [previous](bitcoin#18278 (review)) review is rebasing. MarcoFalke: ACK 3dc27a1 🕍 Tree-SHA512: 62e6a0f2488e3924e559d2074ed460b92e7a0a5d98eab492221cb20d59d04bbe32aef2a8aeba5e4ea9168cfa91acd5bc973dce6677be0180bd7a919354df53ed
Summary: Replace by privateKeysDisabled method to avoid need for GUI to reference internal wallet flags. Also remove adjacent WalletModel canGetAddresses wrapper that serves no purpose and make Wallet::canGetAddresses non-const so it can be implemented by IPC classes in #10102. Backport of Core [[bitcoin/bitcoin#18278 | PR18278]] part [1/6] : bitcoin/bitcoin@77e4b06 Test Plan: ninja all check-all Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D8019
Summary: Avoid overloading method name to work more easily with IPC framework Backport of Core [[bitcoin/bitcoin#18278 | PR18278]] part [2/6] : bitcoin/bitcoin@1c2ab1a Depends on D8019 Test Plan: ninja all check-all Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D8020
…ther interfaces methods Summary: This also simplifies #10102 removing overrides needed to deal with inconsistent case convention Backport of Core [[bitcoin/bitcoin#18278 | PR18278]] part [3/6] : bitcoin/bitcoin@6ceb219 Depends on D8020 Test Plan: ninja all check-all Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D8021
Summary: Make output argument last argument so it works more easily with IPC framework in #10102, and for consistency with other methods Backport of Core [[bitcoin/bitcoin#18278 | PR18278]] part [4/6] : bitcoin/bitcoin@96dfe5c Depends on D8021 Test Plan: ninja all check-all Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D8022
Summary: Move output arguments after input arguments for consistency with other methods, and to work more easily with IPC framework in #10102 Backport of Core [[bitcoin/bitcoin#18278 | PR18278]] part [5/6] : bitcoin/bitcoin@1dca9dc Depends on D8022 The Qt part of PSBT has not been ported so it is absent from this patch. This shouldn't be a problem, because it is a compilation error and trivial to fix, so it can be don then. Test Plan: ninja all check-all Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D8023
Summary: Backport of Core [[bitcoin/bitcoin#18278 | PR18278]] part [6/6] : bitcoin/bitcoin@3dc27a1 Depends on D8023 Test Plan: ninja all check-all Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D8024
This PR is part of the process separation project.
This PR doesn't change behavior at all, it just cleans up code in
src/interfaces
to simplify #10102, and documents coding conventions there better