fix ambiguous call to overloaded function with template specialization

update to monero-project v0.17.1.6
update readme
This commit is contained in:
woodser
2020-12-16 20:34:56 -05:00
parent 41db25c6dd
commit 8724403f51
6 changed files with 31 additions and 50 deletions
+12 -16
View File
@@ -242,15 +242,9 @@ set(
)
if (BUILD_LIBRARY)
add_library(monero-cpp SHARED ${LIBRARY_SRC_FILES})
target_link_libraries(monero-cpp
${Boost_LIBRARIES}
${OPENSSL_LIBRARIES}
${SODIUM_LIBRARY}
${HIDAPI_LIBRARIES}
wallet_merged
wallet_crypto
@@ -277,6 +271,10 @@ if (BUILD_LIBRARY)
version
randomx
${Boost_LIBRARIES}
${OPENSSL_LIBRARIES}
${SODIUM_LIBRARY}
${HIDAPI_LIBRARIES}
${EXTRA_LIBRARIES}
)
endif()
@@ -292,11 +290,6 @@ if (BUILD_SAMPLE)
target_link_libraries(sample_code
${Boost_LIBRARIES}
${OPENSSL_LIBRARIES}
${SODIUM_LIBRARY}
${HIDAPI_LIBRARIES}
wallet_merged
wallet_crypto
#wallet_api
@@ -322,6 +315,10 @@ if (BUILD_SAMPLE)
version
randomx
${Boost_LIBRARIES}
${OPENSSL_LIBRARIES}
${SODIUM_LIBRARY}
${HIDAPI_LIBRARIES}
${EXTRA_LIBRARIES}
)
endif()
@@ -337,11 +334,6 @@ if (BUILD_SCRATCHPAD)
target_link_libraries(scratchpad
${Boost_LIBRARIES}
${OPENSSL_LIBRARIES}
${SODIUM_LIBRARY}
${HIDAPI_LIBRARIES}
wallet_merged
wallet_crypto
#wallet_api
@@ -367,6 +359,10 @@ if (BUILD_SCRATCHPAD)
version
randomx
${Boost_LIBRARIES}
${OPENSSL_LIBRARIES}
${SODIUM_LIBRARY}
${HIDAPI_LIBRARIES}
${EXTRA_LIBRARIES}
)
endif()
+7 -10
View File
@@ -1,6 +1,6 @@
# Monero C++ Library
A C++ library for creating Monero applications using native bindings to [monero v0.17.1.6 'Oxygen Orion'](https://github.com/monero-project/monero/tree/v0.17.1.6).
A C++ library for creating Monero applications using native bindings to [monero v0.17.1.7 'Oxygen Orion'](https://github.com/monero-project/monero/tree/v0.17.1.7).
* Supports fully client-side wallets by wrapping [wallet2.h](https://github.com/monero-project/monero/blob/master/src/wallet/wallet2.h).
* Supports multisig, view-only, and offline wallets.
@@ -161,16 +161,13 @@ This project may be compiled as part of another application or built as a shared
For example, [monero-java](https://github.com/monero-ecosystem/monero-java) compiles this project to a shared library to support Java JNI bindings, while [monero-javascript](https://github.com/monero-ecosystem/monero-javascript) compiles this project to WebAssembly binaries.
1. Install dependencies using your system's package manager:
* Boost
* OpenSSL
* HIDAPI
* Sodium
1. Clone this project repository (unless included as a submodule in another project): `git clone --recurse-submodules https://github.com/monero-ecosystem/monero-cpp.git`
2. Build monero-project:
1. Update submodules: `./bin/update_submodules.sh`
2. `cd ./external/monero-core`
3. Modify CMakeLists.txt: `option(BUILD_GUI_DEPS "Build GUI dependencies." ON)`
4. Run twice to create libwallet_merged.a in addition to other .a libraries: `make release-static -j16`
1. Install [dependencies](https://github.com/monero-project/monero#dependencies) using your system's package manager (boost, openssl, hidapi, sodium, etc)
2. Update submodules: `./bin/update_submodules.sh`
3. `cd ./external/monero-core`
4. Modify CMakeLists.txt: `option(BUILD_GUI_DEPS "Build GUI dependencies." ON)`
5. Run twice to create libwallet_merged.a in addition to other .a libraries: `make release-static -j16`
3. Link to this library's source files in your application or build as a shared library in ./build/: `./bin/build_libmonero_cpp.sh`
## Developer guide
+2 -2
View File
@@ -5,6 +5,6 @@ git submodule update --init --force --recursive
# update monero-core
cd ./external/monero-core
git checkout tags/v0.17.1.6
git pull --ff-only origin tags/v0.17.1.6
git checkout tags/v0.17.1.7
git pull --ff-only origin tags/v0.17.1.7
cd ../../
-18
View File
@@ -136,24 +136,6 @@ std::string monero_utils::serialize(const rapidjson::Document& doc) {
return buffer.GetString();
}
void monero_utils::addJsonMember(std::string key, uint8_t val, rapidjson::Document::AllocatorType& allocator, rapidjson::Value& root, rapidjson::Value& field) {
rapidjson::Value field_key(key.c_str(), key.size(), allocator);
field.SetInt(val);
root.AddMember(field_key, field, allocator);
}
void monero_utils::addJsonMember(std::string key, uint32_t val, rapidjson::Document::AllocatorType& allocator, rapidjson::Value& root, rapidjson::Value& field) {
rapidjson::Value field_key(key.c_str(), key.size(), allocator);
field.SetUint64(val);
root.AddMember(field_key, field, allocator);
}
void monero_utils::addJsonMember(std::string key, uint64_t val, rapidjson::Document::AllocatorType& allocator, rapidjson::Value& root, rapidjson::Value& field) {
rapidjson::Value field_key(key.c_str(), key.size(), allocator);
field.SetUint64(val);
root.AddMember(field_key, field, allocator);
}
void monero_utils::addJsonMember(std::string key, std::string val, rapidjson::Document::AllocatorType& allocator, rapidjson::Value& root, rapidjson::Value& field) {
rapidjson::Value field_key(key.c_str(), key.size(), allocator);
field.SetString(val.c_str(), val.size(), allocator);
+9 -3
View File
@@ -81,9 +81,15 @@ namespace monero_utils
std::string serialize(const rapidjson::Document& doc);
void addJsonMember(std::string key, uint8_t val, rapidjson::Document::AllocatorType& allocator, rapidjson::Value& root, rapidjson::Value& field);
void addJsonMember(std::string key, uint32_t val, rapidjson::Document::AllocatorType& allocator, rapidjson::Value& root, rapidjson::Value& field);
void addJsonMember(std::string key, uint64_t val, rapidjson::Document::AllocatorType& allocator, rapidjson::Value& root, rapidjson::Value& field);
/**
* Add number, string, and boolean json members using template specialization.
*/
template <class T>
void addJsonMember(std::string key, T val, rapidjson::Document::AllocatorType& allocator, rapidjson::Value& root, rapidjson::Value& field) {
rapidjson::Value field_key(key.c_str(), key.size(), allocator);
field.SetInt64((uint64_t) val);
root.AddMember(field_key, field, allocator);
}
void addJsonMember(std::string key, std::string val, rapidjson::Document::AllocatorType& allocator, rapidjson::Value& root, rapidjson::Value& field);
void addJsonMember(std::string key, bool val, rapidjson::Document::AllocatorType& allocator, rapidjson::Value& root);