From 92cb4acd8a748ef2cf6a00a5a9f41975c23127c2 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 27 Jun 2018 15:00:34 +0200 Subject: Also mention regular abi.encode in error message. --- libsolidity/analysis/TypeChecker.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libsolidity') diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 9c4e9021..10953255 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1797,7 +1797,10 @@ bool TypeChecker::visit(FunctionCall const& _functionCall) functionType->kind() == FunctionType::Kind::SHA256 || functionType->kind() == FunctionType::Kind::RIPEMD160 ) - msg += " This function requires a single bytes argument. Use abi.encodePacked(...) to properly encode the values."; + msg += + " This function requires a single bytes argument." + " Use abi.encodePacked(...) to obtain the pre-0.5.0 behaviour" + " or abi.encode(...) to use ABI encoding."; m_errorReporter.typeError(_functionCall.location(), msg); } else if (isPositionalCall) @@ -1853,7 +1856,10 @@ bool TypeChecker::visit(FunctionCall const& _functionCall) functionType->kind() == FunctionType::Kind::SHA256 || functionType->kind() == FunctionType::Kind::RIPEMD160 ) - msg += " This function requires a single bytes argument. Use abi.encodePacked(...) to properly encode the values."; + msg += + " This function requires a single bytes argument." + " Use abi.encodePacked(...) to obtain the pre-0.5.0 behaviour" + " or abi.encode(...) to use ABI encoding."; m_errorReporter.typeError(arguments[i]->location(), msg); } } -- cgit