mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[isoltest] Fixes hex (plus alignment) formatting.
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
|
||||
#include <liblangutil/Common.h>
|
||||
|
||||
#include <libdevcore/StringUtils.h>
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
#include <fstream>
|
||||
@@ -159,13 +161,8 @@ string BytesUtils::formatBoolean(bytes const& _bytes)
|
||||
|
||||
string BytesUtils::formatHex(bytes const& _bytes)
|
||||
{
|
||||
stringstream os;
|
||||
|
||||
string hex{toHex(_bytes, HexPrefix::Add)};
|
||||
boost::algorithm::replace_all(hex, "00", "");
|
||||
os << hex;
|
||||
|
||||
return os.str();
|
||||
u256 value = fromBigEndian<u256>(_bytes);
|
||||
return toCompactHexWithPrefix(value);
|
||||
}
|
||||
|
||||
string BytesUtils::formatHexString(bytes const& _bytes)
|
||||
|
||||
@@ -193,7 +193,7 @@ string TestFunctionCall::formatBytesParameters(
|
||||
fill_n(
|
||||
back_inserter(defaultParameters),
|
||||
ceil(_bytes.size() / 32),
|
||||
Parameter{bytes(), "", ABIType{ABIType::UnsignedDec}, FormatInfo{}}
|
||||
Parameter{bytes(), "", ABIType{ABIType::Hex}, FormatInfo{}}
|
||||
);
|
||||
ContractABIUtils::overwriteParameters(_errorReporter, defaultParameters, _parameters);
|
||||
os << BytesUtils::formatBytesRange(_bytes, defaultParameters, _highlight);
|
||||
|
||||
Reference in New Issue
Block a user