Check for payable when comparing function types

This commit is contained in:
Alex Beregszaszi 2017-08-09 23:10:40 +01:00
parent abe6eb9830
commit 1b32cdcf21

View File

@ -2220,6 +2220,8 @@ string FunctionType::identifier() const
}
if (isConstant())
id += "_constant";
if (isPayable())
id += "_payable";
id += identifierList(m_parameterTypes) + "returns" + identifierList(m_returnParameterTypes);
if (m_gasSet)
id += "gas";
@ -2238,9 +2240,13 @@ bool FunctionType::operator==(Type const& _other) const
if (m_kind != other.m_kind)
return false;
if (m_isConstant != other.isConstant())
return false;
if (m_isPayable != other.isPayable())
return false;
if (m_parameterTypes.size() != other.m_parameterTypes.size() ||
m_returnParameterTypes.size() != other.m_returnParameterTypes.size())
return false;
@ -2399,10 +2405,15 @@ FunctionTypePointer FunctionType::interfaceFunctionType() const
return FunctionTypePointer();
return make_shared<FunctionType>(
paramTypes, retParamTypes,
m_parameterNames, m_returnParameterNames,
m_kind, m_arbitraryParameters,
m_declaration, m_isConstant, m_isPayable
paramTypes,
retParamTypes,
m_parameterNames,
m_returnParameterNames,
m_kind,
m_arbitraryParameters,
m_declaration,
m_isConstant,
m_isPayable
);
}