Change retrieveContract to take name and not index

This commit is contained in:
Alex Beregszaszi
2017-09-11 15:58:30 +01:00
parent fbe24da159
commit 7ed938b95e
3 changed files with 6 additions and 6 deletions
@@ -976,7 +976,7 @@ BOOST_AUTO_TEST_CASE(state_variable_accessors)
SourceUnit const* source;
ContractDefinition const* contract;
source = parseAndAnalyse(text);
BOOST_REQUIRE((contract = retrieveContract(*source, 0)) != nullptr);
BOOST_REQUIRE((contract = retrieveContractByName(*source, "test")) != nullptr);
FunctionTypePointer function = retrieveFunctionBySignature(*contract, "foo()");
BOOST_REQUIRE(function && function->hasDeclaration());
auto returnParams = function->returnParameterTypes();
@@ -1029,7 +1029,7 @@ BOOST_AUTO_TEST_CASE(private_state_variable)
ContractDefinition const* contract;
SourceUnit const* source = parseAndAnalyse(text);
BOOST_CHECK((contract = retrieveContract(*source, 0)) != nullptr);
BOOST_CHECK((contract = retrieveContractByName(*source, "test")) != nullptr);
FunctionTypePointer function;
function = retrieveFunctionBySignature(*contract, "foo()");
BOOST_CHECK_MESSAGE(function == nullptr, "Accessor function of a private variable should not exist");