mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Turn toCompactHexWithPrefix into a template and support unsigned types
This should help with boost::multiprecision versions where explicit unsigned/enum conversion to bigint do not exists (such as boost 1.76)
This commit is contained in:
@@ -404,7 +404,8 @@ inline std::string toHex(u256 val, HexPrefix prefix = HexPrefix::DontAdd)
|
||||
return (prefix == HexPrefix::Add) ? "0x" + str : str;
|
||||
}
|
||||
|
||||
inline std::string toCompactHexWithPrefix(u256 const& _value)
|
||||
template <class T>
|
||||
inline std::string toCompactHexWithPrefix(T _value)
|
||||
{
|
||||
return toHex(toCompactBigEndian(_value, 1), HexPrefix::Add);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user