rename watch-only to view-only

This commit is contained in:
woodser
2020-05-14 11:34:25 -04:00
parent 576df9c40f
commit f7daa09c5d
5 changed files with 17 additions and 17 deletions
+6 -6
View File
@@ -121,13 +121,13 @@ namespace monero {
virtual ~monero_wallet() {}
/**
* Indicates if the wallet is watch-only, meaning it does have the private
* Indicates if the wallet is view-only, meaning it does have the private
* spend key and can therefore only observe incoming outputs.
*
* @return true if the wallet is watch-only, false otherwise
* @return true if the wallet is view-only, false otherwise
*/
virtual bool is_watch_only() const {
throw runtime_error("is_watch_only() not supported");
virtual bool is_view_only() const {
throw runtime_error("is_view_only() not supported");
}
/**
@@ -870,7 +870,7 @@ namespace monero {
}
/**
* Sign unsigned transactions from a watch-only wallet.
* Sign unsigned transactions from a view-only wallet.
*
* @param unsigned_tx_hex is unsigned transaction hex from when the transactions were created
* @return the signed transaction hex
@@ -880,7 +880,7 @@ namespace monero {
}
/**
* Submit signed transactions from a watch-only wallet.
* Submit signed transactions from a view-only wallet.
*
* @param signed_tx_hex is signed transaction hex from signTxs()
* @return the resulting transaction hashes
+6 -6
View File
@@ -2323,7 +2323,7 @@ namespace monero {
// validate request
if (m_w2->key_on_device()) throw runtime_error("command not supported by HW wallet");
if (m_w2->watch_only()) throw runtime_error("command not supported by watch-only wallet");
if (m_w2->watch_only()) throw runtime_error("command not supported by view-only wallet");
if (unsigned_tx_hex.empty() && multisig_tx_hex.empty()) throw runtime_error("no txset provided");
std::vector <wallet2::tx_construction_data> tx_constructions;
@@ -2476,7 +2476,7 @@ namespace monero {
// implementation based on monero-project wallet_rpc_server.cpp::on_sign_transfer()
string monero_wallet_core::sign_txs(const string& unsigned_tx_hex) {
if (m_w2->key_on_device()) throw runtime_error("command not supported by HW wallet");
if (m_w2->watch_only()) throw runtime_error("command not supported by watch-only wallet");
if (m_w2->watch_only()) throw runtime_error("command not supported by view-only wallet");
cryptonote::blobdata blob;
if (!epee::string_tools::parse_hexstr_to_binbuff(unsigned_tx_hex, blob)) throw runtime_error("Failed to parse hex.");
@@ -2992,13 +2992,13 @@ namespace monero {
string monero_wallet_core::prepare_multisig() {
if (m_w2->multisig()) throw runtime_error("This wallet is already multisig");
if (m_w2->watch_only()) throw runtime_error("This wallet is watch-only and cannot be made multisig");
if (m_w2->watch_only()) throw runtime_error("This wallet is view-only and cannot be made multisig");
return m_w2->get_multisig_info();
}
monero_multisig_init_result monero_wallet_core::make_multisig(const vector<string>& multisig_hexes, int threshold, const string& password) {
if (m_w2->multisig()) throw runtime_error("This wallet is already multisig");
if (m_w2->watch_only()) throw runtime_error("This wallet is watch-only and cannot be made multisig");
if (m_w2->watch_only()) throw runtime_error("This wallet is view-only and cannot be made multisig");
boost::lock_guard<boost::mutex> guarg(m_sync_mutex); // do not refresh while making multisig
monero_multisig_init_result result;
result.m_multisig_hex = m_w2->make_multisig(epee::wipeable_string(password), multisig_hexes, threshold);
@@ -3157,8 +3157,8 @@ namespace monero {
m_w2->store_to(path, password);
}
std::string monero_wallet_core::get_keys_file_buffer(const epee::wipeable_string& password, bool watch_only) const {
boost::optional<wallet2::keys_file_data> keys_file_data = m_w2->get_keys_file_data(password, watch_only);
std::string monero_wallet_core::get_keys_file_buffer(const epee::wipeable_string& password, bool view_only) const {
boost::optional<wallet2::keys_file_data> keys_file_data = m_w2->get_keys_file_data(password, view_only);
std::string buf;
::serialization::dump_binary(keys_file_data.get(), buf);
return buf;
+2 -2
View File
@@ -172,7 +172,7 @@ namespace monero {
/**
* Supported wallet methods.
*/
bool is_watch_only() const override { return m_w2->watch_only(); }
bool is_view_only() const override { return m_w2->watch_only(); }
void set_daemon_connection(const string& uri, const string& username = "", const string& password = "") override;
void set_daemon_connection(const boost::optional<monero_rpc_connection>& connection) override;
boost::optional<monero_rpc_connection> get_daemon_connection() const override;
@@ -279,7 +279,7 @@ namespace monero {
/**
* Wallet import and export using buffers and not the file system.
*/
std::string get_keys_file_buffer(const epee::wipeable_string& password, bool watch_only) const;
std::string get_keys_file_buffer(const epee::wipeable_string& password, bool view_only) const;
std::string get_cache_file_buffer(const epee::wipeable_string& password) const;
// --------------------------------- PRIVATE --------------------------------
+1 -1
View File
@@ -178,7 +178,7 @@ namespace monero {
}
// initialize remaining wallet
wallet->m_is_watch_only = !has_spend_key;
wallet->m_is_view_only = !has_spend_key;
wallet->m_network_type = network_type;
if (!spend_key.empty()) {
wallet->m_language = language;
+2 -2
View File
@@ -116,7 +116,7 @@ namespace monero {
/**
* Supported wallet methods.
*/
bool is_watch_only() const override { return m_is_watch_only; }
bool is_view_only() const override { return m_is_view_only; }
monero_version get_version() const override;
monero_network_type get_network_type() const override { return m_network_type; }
string get_mnemonic() const override { return m_mnemonic; }
@@ -138,7 +138,7 @@ namespace monero {
// --------------------------------- PRIVATE --------------------------------
private:
bool m_is_watch_only;
bool m_is_view_only;
monero_network_type m_network_type;
cryptonote::account_base m_account;
string m_mnemonic;