Fix assignment of struct containing array of mappings

This commit is contained in:
mingchuan
2019-05-25 01:33:49 +08:00
parent 2a2cea08dd
commit bf8af89bba
6 changed files with 69 additions and 5 deletions
+2 -1
View File
@@ -371,7 +371,8 @@ shown in the following example:
campaignID = numCampaigns++; // campaignID is return variable
// Creates new struct in memory and copies it to storage.
// We leave out the mapping type, because it is not valid in memory.
// If structs are copied (even from storage to storage), mapping types
// If structs are copied (even from storage to storage),
// types that are not valid outside of storage (ex. mappings and array of mappings)
// are always omitted, because they cannot be enumerated.
campaigns[campaignID] = Campaign(beneficiary, goal, 0, 0);
}