From bda410bb071e0d66f393aed3ee9f96d68a8fbb41 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 7 Aug 2017 16:38:48 +0200 Subject: Helpers. --- libdevcore/CommonData.h | 7 +++++++ libdevcore/Whiskers.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'libdevcore') diff --git a/libdevcore/CommonData.h b/libdevcore/CommonData.h index ab4bfe68..6f40d7be 100644 --- a/libdevcore/CommonData.h +++ b/libdevcore/CommonData.h @@ -145,6 +145,13 @@ inline std::string toHex(u256 val, HexPrefix prefix = HexPrefix::DontAdd) return (prefix == HexPrefix::Add) ? "0x" + str : str; } +inline std::string toCompactHexWithPrefix(u256 val) +{ + std::ostringstream ret; + ret << std::hex << val; + return "0x" + ret.str(); +} + // Algorithms for string and string-like collections. /// Escapes a string into the C-string representation. diff --git a/libdevcore/Whiskers.cpp b/libdevcore/Whiskers.cpp index 4bad8476..b0a4c755 100644 --- a/libdevcore/Whiskers.cpp +++ b/libdevcore/Whiskers.cpp @@ -90,7 +90,7 @@ string Whiskers::replace( string tagName(_match[1]); if (!tagName.empty()) { - assertThrow(_parameters.count(tagName), WhiskersError, "Tag " + tagName + " not found."); + assertThrow(_parameters.count(tagName), WhiskersError, "Value for tag " + tagName + " not provided."); return _parameters.at(tagName); } else -- cgit v1.2.3