Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Merge release/1.4.x into develop #6357

Merged
merged 10 commits into from
Nov 20, 2018
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,18 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
message(FATAL_ERROR "GCC version must be at least 6.0!")
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if ("${CMAKE_GENERATOR}" STREQUAL "Ninja")
add_compile_options(-fdiagnostics-color=always)
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
message(FATAL_ERROR "Clang version must be at least 4.0!")
endif()
if ("${CMAKE_GENERATOR}" STREQUAL "Ninja")
add_compile_options(-fcolor-diagnostics)
endif()
endif()


set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
set(BUILD_DOXYGEN FALSE CACHE BOOL "Build doxygen documentation on every make")
set(BUILD_MONGO_DB_PLUGIN FALSE CACHE BOOL "Build mongo database plugin")
Expand Down
9 changes: 9 additions & 0 deletions CMakeModules/EosioTester.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ set(EOSIO_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@")

enable_testing()

if (UNIX)
if (APPLE)
if (LLVM_DIR STREQUAL "" OR NOT LLVM_DIR)
set(LLVM_DIR "/usr/local/opt/llvm@4/lib/cmake/llvm")
endif()
endif()
endif()


find_package( Gperftools QUIET )
if( GPERFTOOLS_FOUND )
message( STATUS "Found gperftools; compiling tests with TCMalloc")
Expand Down
9 changes: 9 additions & 0 deletions CMakeModules/EosioTesterBuild.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ set(EOSIO_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@")

enable_testing()

if (UNIX)
if (APPLE)
if (LLVM_DIR STREQUAL "" OR NOT LLVM_DIR)
set(LLVM_DIR "/usr/local/opt/llvm@4/lib/cmake/llvm")
endif()
endif()
endif()


find_package( Gperftools QUIET )
if( GPERFTOOLS_FOUND )
message( STATUS "Found gperftools; compiling tests with TCMalloc")
Expand Down
45 changes: 23 additions & 22 deletions plugins/chain_plugin/chain_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1060,31 +1060,32 @@ uint64_t read_only::get_table_index_name(const read_only::get_table_rows_params&

template<>
uint64_t convert_to_type(const string& str, const string& desc) {
uint64_t value = 0;

try {
value = boost::lexical_cast<uint64_t>(str.c_str(), str.size());
} catch( ... ) {
return boost::lexical_cast<uint64_t>(str.c_str(), str.size());
} catch( ... ) { }

try {
auto trimmed_str = str;
boost::trim(trimmed_str);
name s(trimmed_str);
return s.value;
} catch( ... ) { }

if (str.find(',') != string::npos) { // fix #6274 only match formats like 4,EOS
try {
auto trimmed_str = str;
boost::trim(trimmed_str);
name s(trimmed_str);
value = s.value;
} catch( ... ) {
try {
auto symb = eosio::chain::symbol::from_string(str);
value = symb.value();
} catch( ... ) {
try {
value = ( eosio::chain::string_to_symbol( 0, str.c_str() ) >> 8 );
} catch( ... ) {
EOS_ASSERT( false, chain_type_exception, "Could not convert ${desc} string '${str}' to any of the following: "
"uint64_t, valid name, or valid symbol (with or without the precision)",
("desc", desc)("str", str));
}
}
}
auto symb = eosio::chain::symbol::from_string(str);
return symb.value();
} catch( ... ) { }
}

try {
return ( eosio::chain::string_to_symbol( 0, str.c_str() ) >> 8 );
} catch( ... ) {
EOS_ASSERT( false, chain_type_exception, "Could not convert ${desc} string '${str}' to any of the following: "
"uint64_t, valid name, or valid symbol (with or without the precision)",
("desc", desc)("str", str));
}
return value;
}

abi_def get_abi( const controller& db, const name& account ) {
Expand Down
2 changes: 1 addition & 1 deletion programs/cleos/httpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ namespace eosio { namespace client { namespace http {
request_stream << "content-length: " << postjson.size() << "\r\n";
request_stream << "Accept: */*\r\n";
request_stream << "Connection: close\r\n";
request_stream << "\r\n";
// append more customized headers
std::vector<string>::iterator itr;
for (itr = cp.headers.begin(); itr != cp.headers.end(); itr++) {
request_stream << *itr << "\r\n";
}
request_stream << "\r\n";
request_stream << postjson;

if ( print_request ) {
Expand Down