cpp library compiling with camelcase

This commit is contained in:
woodser
2019-08-03 13:38:51 -04:00
parent 2057576493
commit 9360e09ff0
5 changed files with 222 additions and 222 deletions
+6 -6
View File
@@ -228,11 +228,11 @@ set_target_properties(version PROPERTIES IMPORTED_LOCATION
set(
LIBRARY_SRC_FILES
src/utils/MoneroUtils.cpp
src/daemon/MoneroDaemonModel.cpp
src/daemon/MoneroDaemon.cpp
src/wallet/MoneroWalletModel.cpp
src/wallet/MoneroWallet.cpp
src/utils/monero_utils.cpp
src/daemon/monero_daemon_model.cpp
src/daemon/monero_daemon.cpp
src/wallet/monero_wallet_model.cpp
src/wallet/monero_wallet.cpp
)
add_library(monero-cpp SHARED ${LIBRARY_SRC_FILES})
@@ -289,7 +289,7 @@ target_link_libraries(monero-cpp
set(
SCRATCHPAD_SRC_FILES
test/Scratchpad.cpp
test/scratchpad.cpp
)
add_executable(scratchpad ${SCRATCHPAD_SRC_FILES} ${LIBRARY_SRC_FILES})
+8 -8
View File
@@ -97,9 +97,9 @@ namespace monero {
* TODO: switch to boost::optional<string>
*/
struct monero_rpc_connection {
string m_uri;
boost::optional<string> m_username;
boost::optional<string> m_password;
string uri;
boost::optional<string> username;
boost::optional<string> password;
monero_rpc_connection(const string& uri = "", const boost::optional<string>& username = boost::none, const boost::optional<string>& password = boost::none) : uri(uri), username(username), password(password) {}
};
@@ -113,11 +113,11 @@ namespace monero {
* TODO: a header that is transmitted may have fewer fields like cryptonote::block_header; separate?
*/
struct monero_block_header : public serializable_struct {
boost::optional<string> m_id;
boost::optional<uint64_t> m_height;
boost::optional<uint64_t> m_timestamp;
boost::optional<uint64_t> m_size;
boost::optional<uint64_t> m_weight;
boost::optional<string> id;
boost::optional<uint64_t> height;
boost::optional<uint64_t> timestamp;
boost::optional<uint64_t> size;
boost::optional<uint64_t> weight;
boost::optional<uint64_t> long_term_weight;
boost::optional<uint64_t> depth;
boost::optional<uint64_t> difficulty;
File diff suppressed because it is too large Load Diff
+13 -13
View File
@@ -141,41 +141,41 @@ namespace monero {
*
* @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
* @param net_type is the wallet's network type
*/
static monero_wallet* open_wallet(const string& path, const string& password, const monero_network_type network_type);
static monero_wallet* open_wallet(const string& path, const string& password, const monero_network_type net_type);
/**
* Create a new wallet with a randomly generated seed.
*
* @param path is the path to create the wallet
* @param password is the password encrypt the wallet
* @param network_type is the wallet's network type (default = monero_network_type.MAINNET)
* @param net_type is the wallet's network type (default = monero_network_type.MAINNET)
* @param daemon_connection is connection information to a daemon (default = an unconnected wallet)
* @param language is the wallet and mnemonic's language (default = "English")
*/
static monero_wallet* create_wallet_random(const string& path, const string& password);
static monero_wallet* create_wallet_random(const string& path, const string& password, const monero_network_type network_type, const monero_rpc_connection& daemon_connection, const string& language);
static monero_wallet* create_wallet_random(const string& path, const string& password, const monero_network_type net_type, const monero_rpc_connection& daemon_connection, const string& language);
/**
* Create a wallet from an existing mnemonic phrase.
*
* @param path is the path to create the wallet
* @param password is the password encrypt the wallet
* @param network_type is the wallet's network type
* @param net_type is the wallet's network type
* @param mnemonic is the mnemonic of the wallet to construct
* @param daemon_connection is connection information to a daemon (default = an unconnected wallet)
* @param restore_height is the block height to restore (i.e. scan the chain) from (default = 0)
*/
static monero_wallet* create_wallet_from_mnemonic(const string& path, const string& password, const monero_network_type network_type, const string& mnemonic);
static monero_wallet* 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);
static monero_wallet* create_wallet_from_mnemonic(const string& path, const string& password, const monero_network_type net_type, const string& mnemonic);
static monero_wallet* create_wallet_from_mnemonic(const string& path, const string& password, const monero_network_type net_type, const string& mnemonic, const monero_rpc_connection& daemon_connection, uint64_t restore_height);
/**
* Create a wallet from an address, view key, and spend key.
*
* @param path is the path to create the wallet
* @param password is the password encrypt the wallet
* @param network_type is the wallet's network type
* @param net_type is the wallet's network type
* @param address is the address of the wallet to construct
* @param view_key is the view key of the wallet to construct
* @param spend_key is the spend key of the wallet to construct
@@ -183,9 +183,9 @@ namespace monero {
* @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 (default = "English")
*/
static monero_wallet* 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);
static monero_wallet* 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);
static monero_wallet* 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);
static monero_wallet* create_wallet_from_keys(const string& path, const string& password, const monero_network_type net_type, const string& address, const string& view_key, const string& spend_key);
static monero_wallet* create_wallet_from_keys(const string& path, const string& password, const monero_network_type net_type, const string& address, const string& view_key, const string& spend_key, const monero_rpc_connection& daemon_connection, uint64_t restore_height);
static monero_wallet* create_wallet_from_keys(const string& path, const string& password, const monero_network_type net_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);
/**
* Deconstruct the wallet.
@@ -1202,8 +1202,8 @@ namespace monero {
private:
friend struct wallet2_listener;
unique_ptr<tools::wallet2> wallet2; // internal wallet implementation
unique_ptr<wallet2_listener> wallet2_listener; // listener for internal wallet implementation
unique_ptr<tools::wallet2> w2; // internal wallet implementation
unique_ptr<wallet2_listener> w2_listener; // listener for internal wallet implementation
boost::optional<monero_wallet_listener&> listener = boost::none; // wallet's external listener
void init_common();
+7 -7
View File
@@ -13,15 +13,15 @@ bool wallet_exists(string path) {
return wallet_file_exists;
}
void open_wallet(string path, string password, int network_type) {
cout << "open_wallet(" << path << ", " << password << ", " << network_type << ")" << endl;
void open_wallet(string path, string password, int net_type) {
cout << "open_wallet(" << path << ", " << password << ", " << net_type << ")" << endl;
std::unique_ptr<tools::wallet2> wallet;
wallet.reset(new tools::wallet2(cryptonote::network_type::STAGENET, 1, true));
throw runtime_error("Not implemented");
}
void create_wallet_random(string language, int network_type) {
tools::wallet2* wallet = new tools::wallet2(static_cast<cryptonote::network_type>(network_type), 1, true);
void create_wallet_random(string language, int net_type) {
tools::wallet2* wallet = new tools::wallet2(static_cast<cryptonote::network_type>(net_type), 1, true);
wallet->set_seed_language(language);
crypto::secret_key recovery_val, secret_key;
wallet->generate(string(""), string(""), secret_key, false, false);
@@ -53,12 +53,12 @@ int main(int argc, const char* argv[]) {
string path = "test_wallet_1";
string password = "supersecretpassword123";
string language = "English";
int network_type = 2;
int net_type = 2;
MINFO("Wallet exists: " << wallet_exists(path));
// open_wallet(path, password, network_type);
// create_wallet_random(language, network_type);
// open_wallet(path, password, net_type);
// create_wallet_random(language, net_type);
// // create wallet
// monero_wallet* wallet = new monero_wallet();