I have been having problems when wanting to access information from a contract that returns it through a view function. This information is a tuple generated from a struct.
The contract code that generates such information is the following:
enum Grade {
GARDEN,
PRIMARY,
SECONDARY,
PREPARATORY
}
struct Student {
uint256 generation;
Grade grade;
uint256 timestamp;
}
mapping(uint256 => Student) internal students;
function getStudent(uint256 _studentId) public view returns (Student memory) {
return students[_studentId];
}
When accessing the information through the same contract via the getStudent function, it returns a tuple, but the problem is how to access said information through another contract. specifically the first element of the tuple (uint256 generation).
First of all, Thanks