mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Implement struct encoder.
This commit is contained in:
committed by
Alex Beregszaszi
parent
6385641f6e
commit
70d70e7816
@@ -1735,7 +1735,15 @@ unsigned StructType::calldataEncodedSize(bool _padded) const
|
||||
|
||||
bool StructType::isDynamicallyEncoded() const
|
||||
{
|
||||
solAssert(false, "Structs are not yet supported in the ABI.");
|
||||
solAssert(!recursive(), "");
|
||||
for (auto t: memoryMemberTypes())
|
||||
{
|
||||
solAssert(t, "Parameter should have external type.");
|
||||
t = t->interfaceType(false);
|
||||
if (t->isDynamicallyEncoded())
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
u256 StructType::memorySize() const
|
||||
|
||||
@@ -745,7 +745,7 @@ public:
|
||||
virtual MemberList::MemberMap nativeMembers(ContractDefinition const* _currentScope) const override;
|
||||
virtual TypePointer encodingType() const override
|
||||
{
|
||||
return location() == DataLocation::Storage ? std::make_shared<IntegerType>(256) : TypePointer();
|
||||
return location() == DataLocation::Storage ? std::make_shared<IntegerType>(256) : shared_from_this();
|
||||
}
|
||||
virtual TypePointer interfaceType(bool _inLibrary) const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user