Merge commit 'a7d481fb9' into develop_060

This commit is contained in:
chriseth
2019-12-03 20:47:30 +01:00
69 changed files with 1386 additions and 213 deletions
+6 -7
View File
@@ -179,14 +179,13 @@ bool dev::isValidDecimal(string const& _string)
return true;
}
// Returns a quoted string if all characters are printable ASCII chars,
// or its hex representation otherwise.
std::string dev::formatAsStringOrNumber(std::string const& _value)
string dev::formatAsStringOrNumber(string const& _value)
{
if (_value.length() <= 32)
for (auto const& c: _value)
if (c <= 0x1f || c >= 0x7f || c == '"')
return "0x" + h256(_value, h256::AlignLeft).hex();
assertThrow(_value.length() <= 32, StringTooLong, "String to be formatted longer than 32 bytes.");
for (auto const& c: _value)
if (c <= 0x1f || c >= 0x7f || c == '"')
return "0x" + h256(_value, h256::AlignLeft).hex();
return "\"" + _value + "\"";
}
+1
View File
@@ -401,6 +401,7 @@ bool isValidDecimal(std::string const& _string);
/// @returns a quoted string if all characters are printable ASCII chars,
/// or its hex representation otherwise.
/// _value cannot be longer than 32 bytes.
std::string formatAsStringOrNumber(std::string const& _value);
template<typename Container, typename Compare>
+1
View File
@@ -49,6 +49,7 @@ DEV_SIMPLE_EXCEPTION(BadHexCharacter);
DEV_SIMPLE_EXCEPTION(BadHexCase);
DEV_SIMPLE_EXCEPTION(FileError);
DEV_SIMPLE_EXCEPTION(DataTooLong);
DEV_SIMPLE_EXCEPTION(StringTooLong);
// error information to be added to exceptions
using errinfo_comment = boost::error_info<struct tag_comment, std::string>;
+2 -2
View File
@@ -32,8 +32,8 @@
using namespace std;
static_assert(
(JSONCPP_VERSION_MAJOR == 1) && (JSONCPP_VERSION_MINOR == 8) && (JSONCPP_VERSION_PATCH == 4),
"Unexpected jsoncpp version: " JSONCPP_VERSION_STRING ". Expecting 1.8.4."
(JSONCPP_VERSION_MAJOR == 1) && (JSONCPP_VERSION_MINOR == 9) && (JSONCPP_VERSION_PATCH == 2),
"Unexpected jsoncpp version: " JSONCPP_VERSION_STRING ". Expecting 1.9.2."
);
namespace dev