mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 10:19:26 +02:00
refactor: make ExternalSigner NetworkArg() and m_chain private
This commit is contained in:
@ -13,7 +13,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
ExternalSigner::ExternalSigner(const std::string& command, const std::string& fingerprint, const std::string chain, const std::string name): m_command(command), m_fingerprint(fingerprint), m_chain(chain), m_name(name) {}
|
ExternalSigner::ExternalSigner(const std::string& command, const std::string chain, const std::string& fingerprint, const std::string name): m_command(command), m_chain(chain), m_fingerprint(fingerprint), m_name(name) {}
|
||||||
|
|
||||||
const std::string ExternalSigner::NetworkArg() const
|
const std::string ExternalSigner::NetworkArg() const
|
||||||
{
|
{
|
||||||
@ -53,7 +53,7 @@ bool ExternalSigner::Enumerate(const std::string& command, std::vector<ExternalS
|
|||||||
if (model_field.isStr() && model_field.getValStr() != "") {
|
if (model_field.isStr() && model_field.getValStr() != "") {
|
||||||
name += model_field.getValStr();
|
name += model_field.getValStr();
|
||||||
}
|
}
|
||||||
signers.push_back(ExternalSigner(command, fingerprintStr, chain, name));
|
signers.push_back(ExternalSigner(command, chain, fingerprintStr, name));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -21,24 +21,24 @@ private:
|
|||||||
//! The command which handles interaction with the external signer.
|
//! The command which handles interaction with the external signer.
|
||||||
std::string m_command;
|
std::string m_command;
|
||||||
|
|
||||||
|
//! Bitcoin mainnet, testnet, etc
|
||||||
|
std::string m_chain;
|
||||||
|
|
||||||
|
const std::string NetworkArg() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//! @param[in] command the command which handles interaction with the external signer
|
//! @param[in] command the command which handles interaction with the external signer
|
||||||
//! @param[in] fingerprint master key fingerprint of the signer
|
//! @param[in] fingerprint master key fingerprint of the signer
|
||||||
//! @param[in] chain "main", "test", "regtest" or "signet"
|
//! @param[in] chain "main", "test", "regtest" or "signet"
|
||||||
//! @param[in] name device name
|
//! @param[in] name device name
|
||||||
ExternalSigner(const std::string& command, const std::string& fingerprint, const std::string chain, const std::string name);
|
ExternalSigner(const std::string& command, const std::string chain, const std::string& fingerprint, const std::string name);
|
||||||
|
|
||||||
//! Master key fingerprint of the signer
|
//! Master key fingerprint of the signer
|
||||||
std::string m_fingerprint;
|
std::string m_fingerprint;
|
||||||
|
|
||||||
//! Bitcoin mainnet, testnet, etc
|
|
||||||
std::string m_chain;
|
|
||||||
|
|
||||||
//! Name of signer
|
//! Name of signer
|
||||||
std::string m_name;
|
std::string m_name;
|
||||||
|
|
||||||
const std::string NetworkArg() const;
|
|
||||||
|
|
||||||
//! Obtain a list of signers. Calls `<command> enumerate`.
|
//! Obtain a list of signers. Calls `<command> enumerate`.
|
||||||
//! @param[in] command the command which handles interaction with the external signer
|
//! @param[in] command the command which handles interaction with the external signer
|
||||||
//! @param[in,out] signers vector to which new signers (with a unique master key fingerprint) are added
|
//! @param[in,out] signers vector to which new signers (with a unique master key fingerprint) are added
|
||||||
|
Reference in New Issue
Block a user