Merge pull request #7389 from ethereum/isoltest-revert-fix

[isoltest] Fix auto-update when function reverts
This commit is contained in:
chriseth 2019-09-10 11:57:27 +02:00 committed by GitHub
commit 697e04fe5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -9,6 +9,9 @@ contract C {
function g(bool _value) public pure {
require(_value, "Value is false.");
}
function h() public pure returns (uint) {
assert(false);
}
}
// ====
// EVMVersion: >homestead
@ -17,3 +20,4 @@ contract C {
// e() -> FAILURE, hex"08c379a0", 0x20, 19, "Transaction failed."
// f(bool): false -> FAILURE, hex"08c379a0", 0x20, 0
// g(bool): false -> FAILURE, hex"08c379a0", 0x20, 15, "Value is false."
// h() -> FAILURE

View File

@ -126,8 +126,11 @@ string TestFunctionCall::format(
{
boost::optional<ParameterList> abiParams;
if (isFailure && !output.empty())
abiParams = boost::make_optional(ContractABIUtils::failureParameters(output));
if (isFailure)
{
if (!output.empty())
abiParams = boost::make_optional(ContractABIUtils::failureParameters(output));
}
else
abiParams = ContractABIUtils::parametersFromJsonOutputs(
_errorReporter,