Do not try to display checksummed address for too-short/long address literals

This commit is contained in:
Alex Beregszaszi
2017-11-17 00:46:45 +00:00
parent 6ebc094474
commit 1d5dd909b4
3 changed files with 5 additions and 3 deletions
+2
View File
@@ -587,5 +587,7 @@ bool Literal::passesAddressChecksum() const
std::string Literal::getChecksummedAddress() const
{
solAssert(isHexNumber(), "Expected hex number");
if (value().length != 42)
return string();
return dev::getChecksummedAddress(value());
}
+1 -1
View File
@@ -1613,7 +1613,7 @@ public:
bool looksLikeAddress() const;
/// @returns true if it passes the address checksum test.
bool passesAddressChecksum() const;
/// @returns the checksummed version of an address
/// @returns the checksummed version of an address (or empty string if not valid)
std::string getChecksummedAddress() const;
private: