Merge commit '0ca1a51033a9767d4fb039c5289ad366610be98e' into MergeUpstream3

This commit is contained in:
Doyle 2020-05-18 15:11:46 +10:00
commit 7264cae56b
8 changed files with 26 additions and 9 deletions

View file

@ -159,7 +159,7 @@ if(Protobuf_FOUND AND USE_DEVICE_TREZOR AND TREZOR_PYTHON AND Protobuf_COMPILE_T
set(TREZOR_LIBUSB_LIBRARIES "") set(TREZOR_LIBUSB_LIBRARIES "")
if(LibUSB_COMPILE_TEST_PASSED) if(LibUSB_COMPILE_TEST_PASSED)
list(APPEND TREZOR_LIBUSB_LIBRARIES ${LibUSB_LIBRARIES}) list(APPEND TREZOR_LIBUSB_LIBRARIES ${LibUSB_LIBRARIES} ${LIBUSB_DEP_LINKER})
message(STATUS "Trezor compatible LibUSB found at: ${LibUSB_INCLUDE_DIRS}") message(STATUS "Trezor compatible LibUSB found at: ${LibUSB_INCLUDE_DIRS}")
endif() endif()
@ -174,7 +174,7 @@ if(Protobuf_FOUND AND USE_DEVICE_TREZOR AND TREZOR_PYTHON AND Protobuf_COMPILE_T
if (TREZOR_LIBUSB_LIBRARIES) if (TREZOR_LIBUSB_LIBRARIES)
list(APPEND TREZOR_DEP_LIBS ${TREZOR_LIBUSB_LIBRARIES}) list(APPEND TREZOR_DEP_LIBS ${TREZOR_LIBUSB_LIBRARIES})
string(APPEND TREZOR_DEP_LINKER " -lusb-1.0") string(APPEND TREZOR_DEP_LINKER " -lusb-1.0 ${LIBUSB_DEP_LINKER}")
endif() endif()
endif() endif()
endif() endif()

View file

@ -119,6 +119,12 @@ if ( LibUSB_FOUND )
find_library(IOKIT IOKit) find_library(IOKIT IOKit)
list(APPEND TEST_COMPILE_EXTRA_LIBRARIES ${IOKIT}) list(APPEND TEST_COMPILE_EXTRA_LIBRARIES ${IOKIT})
list(APPEND TEST_COMPILE_EXTRA_LIBRARIES ${COREFOUNDATION}) list(APPEND TEST_COMPILE_EXTRA_LIBRARIES ${COREFOUNDATION})
if(STATIC)
find_library(OBJC objc.a)
set(LIBUSB_DEP_LINKER ${OBJC})
list(APPEND TEST_COMPILE_EXTRA_LIBRARIES ${LIBUSB_DEP_LINKER})
endif()
endif() endif()
endif() endif()
if (WIN32) if (WIN32)

View file

@ -22,7 +22,7 @@
#endif #endif
#include <boost/archive/basic_archive.hpp> #include <boost/archive/basic_archive.hpp>
#include <boost/detail/endian.hpp> #include <boost/predef/other/endian.h>
#include <boost/archive/impl/archive_serializer_map.ipp> #include <boost/archive/impl/archive_serializer_map.ipp>

View file

@ -226,7 +226,7 @@ public:
#include <istream> #include <istream>
#include <string> #include <string>
#include <boost/detail/endian.hpp> #include <boost/predef/other/endian.h>
#include <boost/serialization/throw_exception.hpp> #include <boost/serialization/throw_exception.hpp>
#include <boost/archive/archive_exception.hpp> #include <boost/archive/archive_exception.hpp>
@ -252,12 +252,12 @@ portable_binary_iarchive::load_impl(boost::intmax_t & l, char maxsize){
); );
char * cptr = reinterpret_cast<char *>(& l); char * cptr = reinterpret_cast<char *>(& l);
#ifdef BOOST_BIG_ENDIAN #if BOOST_ENDIAN_BIG_BYTE
cptr += (sizeof(boost::intmax_t) - size); cptr += (sizeof(boost::intmax_t) - size);
#endif #endif
this->primitive_base_t::load_binary(cptr, size); this->primitive_base_t::load_binary(cptr, size);
#ifdef BOOST_BIG_ENDIAN #if BOOST_ENDIAN_BIG_BYTE
if(m_flags & endian_little) if(m_flags & endian_little)
#else #else
if(m_flags & endian_big) if(m_flags & endian_big)

View file

@ -221,7 +221,7 @@ public:
// See http://www.boost.org for updates, documentation, and revision history. // See http://www.boost.org for updates, documentation, and revision history.
#include <ostream> #include <ostream>
#include <boost/detail/endian.hpp> #include <boost/predef/other/endian.h>
namespace boost { namespace archive { namespace boost { namespace archive {
@ -258,7 +258,7 @@ portable_binary_oarchive::save_impl(
else else
ll = l; ll = l;
char * cptr = reinterpret_cast<char *>(& ll); char * cptr = reinterpret_cast<char *>(& ll);
#ifdef BOOST_BIG_ENDIAN #if BOOST_ENDIAN_BIG_BYTE
cptr += (sizeof(boost::intmax_t) - size); cptr += (sizeof(boost::intmax_t) - size);
if(m_flags & endian_little) if(m_flags & endian_little)
reverse_bytes(size, cptr); reverse_bytes(size, cptr);

View file

@ -790,6 +790,12 @@ bool simple_wallet::encrypted_seed(const std::vector<std::string> &args/* = std:
return print_seed(true); return print_seed(true);
} }
bool simple_wallet::restore_height(const std::vector<std::string> &args/* = std::vector<std::string>()*/)
{
success_msg_writer() << m_wallet->get_refresh_from_block_height();
return true;
}
bool simple_wallet::seed_set_language(const std::vector<std::string> &args/* = std::vector<std::string>()*/) bool simple_wallet::seed_set_language(const std::vector<std::string> &args/* = std::vector<std::string>()*/)
{ {
if (m_wallet->key_on_device()) if (m_wallet->key_on_device())
@ -2668,6 +2674,9 @@ simple_wallet::simple_wallet()
m_cmd_binder.set_handler("seed", m_cmd_binder.set_handler("seed",
boost::bind(&simple_wallet::seed, this, _1), boost::bind(&simple_wallet::seed, this, _1),
tr("Display the Electrum-style mnemonic seed")); tr("Display the Electrum-style mnemonic seed"));
m_cmd_binder.set_handler("restore_height",
boost::bind(&simple_wallet::restore_height, this, _1),
tr("Display the restore height"));
m_cmd_binder.set_handler("set", m_cmd_binder.set_handler("set",
boost::bind(&simple_wallet::set_variable, this, _1), boost::bind(&simple_wallet::set_variable, this, _1),
tr(USAGE_SET_VARIABLE), tr(USAGE_SET_VARIABLE),

View file

@ -114,6 +114,7 @@ namespace cryptonote
bool spendkey(const std::vector<std::string> &args = std::vector<std::string>()); bool spendkey(const std::vector<std::string> &args = std::vector<std::string>());
bool seed(const std::vector<std::string> &args = std::vector<std::string>()); bool seed(const std::vector<std::string> &args = std::vector<std::string>());
bool encrypted_seed(const std::vector<std::string> &args = std::vector<std::string>()); bool encrypted_seed(const std::vector<std::string> &args = std::vector<std::string>());
bool restore_height(const std::vector<std::string> &args = std::vector<std::string>());
/*! /*!
* \brief Sets seed language. * \brief Sets seed language.

View file

@ -27,6 +27,7 @@
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <array> #include <array>
#include <boost/predef/other/endian.h>
#include <boost/endian/conversion.hpp> #include <boost/endian/conversion.hpp>
#include <boost/range/algorithm/equal.hpp> #include <boost/range/algorithm/equal.hpp>
#include <boost/range/algorithm_ext/iota.hpp> #include <boost/range/algorithm_ext/iota.hpp>
@ -135,7 +136,7 @@ namespace
EXPECT_FALSE( lhs >= rhs ); \ EXPECT_FALSE( lhs >= rhs ); \
EXPECT_TRUE( rhs >= lhs ) EXPECT_TRUE( rhs >= lhs )
#ifdef BOOST_LITTLE_ENDIAN #if BOOST_ENDIAN_LITTLE_BYTE
#define CHECK_LESS_ENDIAN(lhs, rhs) CHECK_LESS( rhs , lhs ) #define CHECK_LESS_ENDIAN(lhs, rhs) CHECK_LESS( rhs , lhs )
#else #else
#define CHECK_LESS_ENDIAN(lhs, rhs) CHECK_LESS( lhs , rhs ) #define CHECK_LESS_ENDIAN(lhs, rhs) CHECK_LESS( lhs , rhs )