Let's say I have a struct & a mapping like this:
struct myStruct {
address addr;
uint256 price;
bool approved;
}
mapping(string => myStruct) mappy;
How can I retrieve all the keys? I know solidity will generate getters so if I have the key I can retrieve the info from inside the struct. But the keys are unknown to me and I need to retrieve the complete struct.
Maybe a better solution would be to have a public variable which would be the size of the struct and an index has key and store the key in the struct? That way I will know the size and I suppose I can iterate it