Add push() for dynamic storage arrays

This commit is contained in:
Leonardo Alt
2019-09-17 13:47:33 +02:00
parent 5b3efee93b
commit 43d6e00b14
12 changed files with 250 additions and 47 deletions
+8 -1
View File
@@ -1781,10 +1781,17 @@ MemberList::MemberMap ArrayType::nativeMembers(ContractDefinition const*) const
if (isDynamicallySized() && location() == DataLocation::Storage)
{
members.emplace_back("push", TypeProvider::function(
TypePointers{},
TypePointers{baseType()},
TypePointers{TypeProvider::uint256()},
strings{},
strings{string()},
isByteArray() ? FunctionType::Kind::ByteArrayPush : FunctionType::Kind::ArrayPush
));
members.emplace_back("push", TypeProvider::function(
TypePointers{baseType()},
TypePointers{},
strings{string()},
strings{},
isByteArray() ? FunctionType::Kind::ByteArrayPush : FunctionType::Kind::ArrayPush
));
members.emplace_back("pop", TypeProvider::function(