Merge pull request #10357 from ethereum/ast-interfaceid

Change AST::interfaceId() to uint32_t
This commit is contained in:
Alex Beregszaszi 2020-11-20 12:48:14 +00:00 committed by GitHub
commit 3ef4736fd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -198,11 +198,11 @@ vector<pair<util::FixedHash<4>, FunctionTypePointer>> const& ContractDefinition:
});
}
uint64_t ContractDefinition::interfaceId() const
uint32_t ContractDefinition::interfaceId() const
{
uint64_t result{0};
uint32_t result{0};
for (auto const& function: interfaceFunctionList(false))
result ^= util::fromBigEndian<uint64_t>(function.first.ref());
result ^= util::fromBigEndian<uint32_t>(function.first.ref());
return result;
}

View File

@ -515,7 +515,7 @@ public:
std::map<util::FixedHash<4>, FunctionTypePointer> interfaceFunctions(bool _includeInheritedFunctions = true) const;
std::vector<std::pair<util::FixedHash<4>, FunctionTypePointer>> const& interfaceFunctionList(bool _includeInheritedFunctions = true) const;
/// @returns the EIP-165 compatible interface identifier. This will exclude inherited functions.
uint64_t interfaceId() const;
uint32_t interfaceId() const;
/// @returns a list of all declarations in this contract
std::vector<Declaration const*> declarations() const { return filteredNodes<Declaration>(m_subNodes); }