Some fixes for PR comments

This commit is contained in:
Anton Bukov 2023-10-02 12:46:10 +02:00
parent a522aea3c1
commit de5af35fca
2 changed files with 8 additions and 5 deletions

View File

@ -403,12 +403,11 @@ void StructDefinition::insertEip712EncodedSubtypes(std::set<std::string>& subtyp
declaration = m_members[i]->type()->typeDefinition();
break;
case Type::Category::Array:
if (auto const* arrayType = dynamic_cast<ArrayType const*>(m_members[i]->type()))
{
auto const* arrayType = dynamic_cast<ArrayType const*>(m_members[i]->type());
solAssert(!!arrayType);
if (auto finalyBaseType = dynamic_cast<StructType const*>(arrayType->finalBaseType(false)))
if (auto finalBaseType = dynamic_cast<StructType const*>(arrayType->finalBaseType(false)))
{
declaration = finalyBaseType->typeDefinition();
declaration = finalBaseType->typeDefinition();
}
}
break;

View File

@ -357,7 +357,11 @@ public:
/// @returns the canonical name of this type for use in library function signatures.
virtual std::string canonicalName() const { return toString(true); }
virtual std::string humanReadableName() const { return toString(); }
virtual std::string eip712TypeName() const { return encodingType()->toString(true); }
virtual std::string eip712TypeName() const
{
solAssert(isEIP712AllowedStructMemberType(), "Invalid type ...");
return encodingType()->toString(true);
}
virtual bool isEIP712AllowedStructMemberType() const { return false; }
/// @returns the signature of this type in external functions, i.e. `uint256` for integers
/// or `(uint256,bytes8)[2]` for an array of structs. If @a _structsByName,