Skip to content

Commit

Permalink
update to monero-project v0.18.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Aug 6, 2022
1 parent 583a212 commit ff965cb
Show file tree
Hide file tree
Showing 8 changed files with 153 additions and 133 deletions.
51 changes: 27 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -std=c++11 -F/Library/Frameworks -
project(MoneroCppLibrary)

set(BUILD_LIBRARY ON)
option(BUILD_SAMPLE "Build sample" ON)
option(BUILD_SCRATCHPAD "Build scratchpad" ON)
set(BUILD_SAMPLE ON)
set(BUILD_SCRATCHPAD ON)

###################
# monero-project
Expand Down Expand Up @@ -137,7 +137,6 @@ if (APPLE AND NOT IOS)
endif()

find_package(HIDAPI REQUIRED)

message(STATUS "Using HIDAPI include dir at ${HIDAPI_INCLUDE_DIR}")
add_definitions(-DHAVE_HIDAPI)
include_directories(${HIDAPI_INCLUDE_DIR})
Expand All @@ -151,10 +150,6 @@ message(STATUS "Using monero-project build" : ${MONERO_PROJECT_BUILD})

list(APPEND CMAKE_MODULE_PATH "${MONERO_PROJECT}/cmake")

add_library(wallet_merged STATIC IMPORTED)
set_target_properties(wallet_merged PROPERTIES IMPORTED_LOCATION
${MONERO_PROJECT_BUILD}/lib/libwallet_merged.a)

add_library(wallet STATIC IMPORTED)
set_target_properties(wallet PROPERTIES IMPORTED_LOCATION
${MONERO_PROJECT_BUILD}/lib/libwallet.a)
Expand All @@ -172,16 +167,24 @@ set_target_properties(epee PROPERTIES IMPORTED_LOCATION
${MONERO_PROJECT_BUILD}/contrib/epee/src/libepee.a)

find_package(Unbound)
if ("${UNBOUND_LIBRARIES}" MATCHES "libunbound.so")
if ("${UNBOUND_LIBRARIES}" MATCHES "libunbound")
message(STATUS "Using libunbound: ${UNBOUND_LIBRARIES}")
add_library(unbound SHARED IMPORTED)
set_target_properties(unbound PROPERTIES IMPORTED_LOCATION
${UNBOUND_LIBRARIES})
else()
add_library(unbound STATIC IMPORTED)
set_target_properties(unbound PROPERTIES IMPORTED_LOCATION
${MONERO_PROJECT_BUILD}/external/unbound/libunbound.a)
endif()

add_library(rpc_base STATIC IMPORTED)
set_target_properties(rpc_base PROPERTIES IMPORTED_LOCATION
${MONERO_PROJECT_BUILD}/src/rpc/librpc_base.a)

add_library(net STATIC IMPORTED)
set_target_properties(net PROPERTIES IMPORTED_LOCATION
${MONERO_PROJECT_BUILD}/src/net/libnet.a)

add_library(hardforks STATIC IMPORTED)
set_target_properties(hardforks PROPERTIES IMPORTED_LOCATION
${MONERO_PROJECT_BUILD}/src/hardforks/libhardforks.a)

add_library(easylogging STATIC IMPORTED)
set_target_properties(easylogging PROPERTIES IMPORTED_LOCATION
Expand Down Expand Up @@ -270,11 +273,11 @@ if (BUILD_LIBRARY)
add_library(monero-cpp SHARED ${LIBRARY_SRC_FILES})

target_link_libraries(monero-cpp

wallet_merged
wallet_crypto
#wallet_api
wallet
wallet_crypto
rpc_base
net
hardforks
lmdb
epee
unbound
Expand Down Expand Up @@ -333,11 +336,11 @@ if (BUILD_SAMPLE)
add_executable(sample_code ${LIBRARY_SRC_FILES} ${SAMPLE_CODE_SRC_FILES})

target_link_libraries(sample_code

wallet_merged
wallet_crypto
#wallet_api
wallet
wallet_crypto
rpc_base
net
hardforks
lmdb
epee
unbound
Expand Down Expand Up @@ -381,11 +384,11 @@ if (BUILD_SCRATCHPAD)
add_executable(scratchpad ${LIBRARY_SRC_FILES} ${SCRATCHPAD_SRC_FILES})

target_link_libraries(scratchpad

wallet_merged
wallet_crypto
#wallet_api
wallet
wallet_crypto
rpc_base
net
hardforks
lmdb
epee
unbound
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Monero C++ Library

A C++ library for creating Monero applications using native bindings to [monero v0.17.3.2 'Oxygen Orion'](https://github.com/monero-project/monero/tree/v0.17.3.2).
A C++ library for creating Monero applications using native bindings to [monero v0.18.0.0 'Flourine Fermie'](https://github.com/monero-project/monero/tree/v0.18.0.0).

* 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.
Expand Down
2 changes: 1 addition & 1 deletion external/monero-project
Submodule monero-project updated 922 files
7 changes: 5 additions & 2 deletions src/utils/monero_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "mnemonics/electrum-words.h"
#include "mnemonics/english.h"
#include "string_tools.h"
#include "byte_stream.h"

using namespace cryptonote;
using namespace monero_utils;
Expand Down Expand Up @@ -141,7 +142,9 @@ void monero_utils::validate_private_spend_key(const std::string& private_spend_k
void monero_utils::json_to_binary(const std::string &json, std::string &bin) {
epee::serialization::portable_storage ps;
ps.load_from_json(json);
ps.store_to_binary(bin);
epee::byte_stream bs;
ps.store_to_binary(bs);
bin = std::string((char*) bs.data(), bs.size());
}

void monero_utils::binary_to_json(const std::string &bin, std::string &json) {
Expand Down Expand Up @@ -347,7 +350,7 @@ std::shared_ptr<monero_tx> monero_utils::cn_tx_to_tx(const cryptonote::transacti
output->m_tx = tx;
tx->m_outputs.push_back(output);
output->m_amount = cnVout.amount;
const crypto::public_key& cnStealthPublicKey = boost::get<txout_to_key>(cnVout.target).key;
const crypto::public_key& cnStealthPublicKey = boost::get<txout_to_tagged_key>(cnVout.target).key;
output->m_stealth_public_key = epee::string_tools::pod_to_hex(cnStealthPublicKey);
}

Expand Down
10 changes: 5 additions & 5 deletions src/wallet/monero_wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -1160,8 +1160,8 @@ namespace monero {
* @param config specifies configuration for a potential tx
* @return is the payment uri
*/
virtual std::string create_payment_uri(const monero_tx_config& config) const {
throw std::runtime_error("create_payment_uri() not supported");
virtual std::string get_payment_uri(const monero_tx_config& config) const {
throw std::runtime_error("get_payment_uri() not supported");
}

/**
Expand Down Expand Up @@ -1265,9 +1265,9 @@ namespace monero {
* @param multisig_hexes are multisig hex from each participant
* @param threshold is the number of signatures needed to sign transfers
* @password is the wallet password
* @return the result which has the multisig's address xor this wallet's multisig hex to share with participants iff not N/N
* @return this wallet's multisig hex to share with participants
*/
virtual monero_multisig_init_result make_multisig(const std::vector<std::string>& multisig_hexes, int threshold, const std::string& password) {
virtual std::string make_multisig(const std::vector<std::string>& multisig_hexes, int threshold, const std::string& password) {
throw std::runtime_error("make_multisig() not supported");
}

Expand All @@ -1280,7 +1280,7 @@ namespace monero {
* @param password is the wallet's password // TODO monero-project: redundant? wallet is created with password
* @return the result which has the multisig's address xor this wallet's multisig hex to share with participants iff not done
*/
virtual monero_multisig_init_result exchange_multisig_keys(const std::vector<std::string>& mutisig_hexes, const std::string& password) {
virtual monero_multisig_init_result exchange_multisig_keys(const std::vector<std::string>& mutisig_hexes, const std::string& password) {
throw std::runtime_error("exchange_multisig_keys() not supported");
}

Expand Down
Loading

0 comments on commit ff965cb

Please sign in to comment.