revert order of core wallet constructor args

This commit is contained in:
woodser
2020-01-11 08:23:11 -05:00
parent 9b2ba5e62a
commit 78b705c8fe
2 changed files with 19 additions and 20 deletions
+5 -5
View File
@@ -798,7 +798,7 @@ namespace monero {
return wallet_file_exists;
}
monero_wallet_core* monero_wallet_core::open_wallet(const monero_network_type network_type, const string& path, const string& password) {
monero_wallet_core* monero_wallet_core::open_wallet(const string& path, const string& password, const monero_network_type network_type) {
MTRACE("open_wallet(" << path << ", " << password << ", " << network_type << ")");
monero_wallet_core* wallet = new monero_wallet_core();
wallet->m_w2 = unique_ptr<tools::wallet2>(new tools::wallet2(static_cast<cryptonote::network_type>(network_type), 1, true));
@@ -808,7 +808,7 @@ namespace monero {
return wallet;
}
monero_wallet_core* monero_wallet_core::open_wallet(const monero_network_type network_type, const string& keys_data, const string& cache_data, const string& password, const monero_rpc_connection& daemon_connection, shared_ptr<epee::net_utils::http::abstract_http_client> http_client) {
monero_wallet_core* monero_wallet_core::open_wallet(const string& password, const monero_network_type network_type, const string& keys_data, const string& cache_data, const monero_rpc_connection& daemon_connection, shared_ptr<epee::net_utils::http::abstract_http_client> http_client) {
MTRACE("open_wallet(...buffers...)");
cout << "open_wallet(...buffers...)" << endl;
monero_wallet_core* wallet = new monero_wallet_core();
@@ -821,7 +821,7 @@ namespace monero {
return wallet;
}
monero_wallet_core* monero_wallet_core::create_wallet_random(const monero_network_type network_type, const string& password, const string& path, const monero_rpc_connection& daemon_connection, const string& language, shared_ptr<epee::net_utils::http::abstract_http_client> http_client) {
monero_wallet_core* monero_wallet_core::create_wallet_random(const string& path, const string& password, const monero_network_type network_type, const monero_rpc_connection& daemon_connection, const string& language, shared_ptr<epee::net_utils::http::abstract_http_client> http_client) {
MTRACE("create_wallet_random(path, password, network_type, daemon_connection, language)");
monero_wallet_core* wallet = new monero_wallet_core();
if (http_client == nullptr) wallet->m_w2 = unique_ptr<tools::wallet2>(new tools::wallet2(static_cast<cryptonote::network_type>(network_type), 1, true));
@@ -835,7 +835,7 @@ namespace monero {
return wallet;
}
monero_wallet_core* monero_wallet_core::create_wallet_from_mnemonic(const monero_network_type network_type, const string& mnemonic, const string& password, const string& path, const monero_rpc_connection& daemon_connection, uint64_t restore_height, const string& seed_offset, shared_ptr<epee::net_utils::http::abstract_http_client> http_client) {
monero_wallet_core* monero_wallet_core::create_wallet_from_mnemonic(const string& path, const string& password, const monero_network_type network_type, const string& mnemonic, const monero_rpc_connection& daemon_connection, uint64_t restore_height, const string& seed_offset, shared_ptr<epee::net_utils::http::abstract_http_client> http_client) {
MTRACE("create_wallet_from_mnemonic(path, password, mnemonic, network_type, daemon_connection, restore_height)");
monero_wallet_core* wallet = new monero_wallet_core();
@@ -860,7 +860,7 @@ namespace monero {
return wallet;
}
monero_wallet_core* monero_wallet_core::create_wallet_from_keys(const monero_network_type network_type, const string& address, const string& view_key, const string& spend_key, const string& password, const string& path, const monero_rpc_connection& daemon_connection, uint64_t restore_height, const string& language) {
monero_wallet_core* monero_wallet_core::create_wallet_from_keys(const string& path, const string& password, const monero_network_type network_type, const string& address, const string& view_key, const string& spend_key, const monero_rpc_connection& daemon_connection, uint64_t restore_height, const string& language) {
MTRACE("create_wallet_from_keys(path, password, address, view_key, spend_key, network_type, daemon_connection, restore_height, language)");
monero_wallet_core* wallet = new monero_wallet_core();
+14 -15
View File
@@ -91,71 +91,70 @@ namespace monero {
/**
* Open an existing wallet from disk.
*
* @param network_type is the wallet's network type
* @param path is the path to the wallet file to open
* @param password is the password of the wallet file to open
* @param network_type is the wallet's network type
* @return a pointer to the wallet instance
*/
static monero_wallet_core* open_wallet(const monero_network_type network_type, const string& path, const string& password);
static monero_wallet_core* open_wallet(const string& path, const string& password, const monero_network_type network_type);
/**
* Open an existing wallet from data buffers.
* Open an in-memory wallet from existing data buffers.
*
* TODO: support path = "" which autosaves?
*
* @param password is the password of the wallet file to open
* @param network_type is the wallet's network type
* @param keys_data contains the contents of the ".keys" file
* @param cache_data contains the contents of the wallet cache file (no extension)
* @param password is the password of the wallet file to open
* @param daemon_connection is connection information to a daemon (default = an unconnected wallet)
* @param http_client allows the http client to be overriden (defaults to monero-project's http_client.h)
* @return a pointer to the wallet instance
*/
static monero_wallet_core* open_wallet(const monero_network_type, const string& keys_data, const string& cache_data, const string& password, const monero_rpc_connection& daemon_connection = monero_rpc_connection(), shared_ptr<epee::net_utils::http::abstract_http_client> http_client = nullptr);
static monero_wallet_core* open_wallet(const string& password, const monero_network_type, const string& keys_data, const string& cache_data, const monero_rpc_connection& daemon_connection = monero_rpc_connection(), shared_ptr<epee::net_utils::http::abstract_http_client> http_client = nullptr);
/**
* Create a new wallet with a randomly generated seed.
*
* @param network_type is the wallet's network type's
* @param path is the path to create the wallet ("" for an in-memory wallet)
* @param password is the password encrypt the wallet
* @param path is the path to create the wallet (defaults to in-memory wallet with path "")
* @param network_type is the wallet's network type's
* @param daemon_connection is connection information to a daemon (defaults to an unconnected wallet)
* @param language is the wallet and mnemonic's language (defaults to "English")
* @param http_client allows the http client to be overriden (defaults to monero-project's http_client.h)
* @return a pointer to the wallet instance
*/
static monero_wallet_core* create_wallet_random(const monero_network_type network_type, const string& password, const string& path = "", const monero_rpc_connection& daemon_connection = monero_rpc_connection(), const string& language = "English", shared_ptr<epee::net_utils::http::abstract_http_client> http_client = nullptr);
static monero_wallet_core* create_wallet_random(const string& path, const string& password, const monero_network_type network_type, const monero_rpc_connection& daemon_connection = monero_rpc_connection(), const string& language = "English", shared_ptr<epee::net_utils::http::abstract_http_client> http_client = nullptr);
/**
* Create a wallet from an existing mnemonic phrase.
*
* @param network_type is the wallet's network type
* @param path is the path to create the wallet ("" for an in-memory wallet)
* @param password is the password encrypt the wallet * @param network_type is the wallet's network type
* @param mnemonic is the mnemonic of the wallet to construct
* @param password is the password encrypt the wallet
* @param path is the path to create the wallet (defaults to in-memory wallet with path "")
* @param daemon_connection is connection information to a daemon (defaults to an unconnected wallet)
* @param restore_height is the block height to restore from (default = 0)
* @param seed_offset is the offset used to derive a new seed from the given mnemonic to recover a secret wallet from the mnemonic phrase (default = "")
* @param http_client allows the http client to be overriden (defaults to monero-project's http_client.h)
* @return a pointer to the wallet instance
*/
static monero_wallet_core* create_wallet_from_mnemonic(const monero_network_type network_type, const string& mnemonic, const string& password, const string& path = "", const monero_rpc_connection& daemon_connection = monero_rpc_connection(), uint64_t restore_height = 0, const string& seed_offset = "", shared_ptr<epee::net_utils::http::abstract_http_client> http_client = nullptr);
static monero_wallet_core* create_wallet_from_mnemonic(const string& path, const string& password, const monero_network_type network_type, const string& mnemonic, const monero_rpc_connection& daemon_connection = monero_rpc_connection(), uint64_t restore_height = 0, const string& seed_offset = "", shared_ptr<epee::net_utils::http::abstract_http_client> http_client = nullptr);
/**
* Create a wallet from an address, view key, and spend key.
*
* @param path is the path to create the wallet ("" for an in-memory wallet)
* @param password is the password encrypt the wallet (defaults to in-memory wallet with password "")
* @param network_type is the wallet's network type
* @param address is the address of the wallet to construct
* @param view_key is the private view key of the wallet to construct
* @param spend_key is the private spend key of the wallet to construct
* @param password is the password encrypt the wallet (defaults to in-memory wallet with password "")
* @param path is the path to create the wallet (defaults to in-memory wallet with path "")
* @param daemon_connection is connection information to a daemon (defaults to an unconnected wallet)
* @param restore_height is the block height to restore (i.e. scan the chain) from (default = 0)
* @param language is the wallet and mnemonic's language (defaults to "English")
* @return a pointer to the wallet instance
*/
static monero_wallet_core* create_wallet_from_keys(const monero_network_type network_type, const string& address, const string& view_key, const string& spend_key, const string& password, const string& path = "", const monero_rpc_connection& daemon_connection = monero_rpc_connection(), uint64_t restore_height = 0, const string& language = "English");
static monero_wallet_core* create_wallet_from_keys(const string& path, const string& password, const monero_network_type network_type, const string& address, const string& view_key, const string& spend_key, const monero_rpc_connection& daemon_connection = monero_rpc_connection(), uint64_t restore_height = 0, const string& language = "English");
/**
* Get a list of available languages for the wallet's mnemonic phrase.