When trying to return a struct with Solidity like this:
function getAssetStructById(uint256 assetId) constant returns (asst _asset) {
return (assetsById[assetId]);
}
This is the compilation error it throws:
Error: Internal type is not allowed for public or external functions.
So, how can I get the data of the struct returned? I tried returning every field of the struct but this is not working anymore once you reach 9 data fields, getting the error:
'Stack too deep' compiler error.
Ref.: Is there any limitation for the number of the return values from Solidity functions?
This is the struct I would like the function to return:
struct asst {
uint256 assetId;
uint256 next;
uint256 prev;
uint256 timestampCreation;
address assetOwner;
address issuer;
string content;
uint256 sellPrice;
assetState state;
}
Any idea how to do that on Solidity? Thx!