I have a structure data with double mapping for storing and fetching details. Here is the code :
struct data {
uint a;
uint b;
}
mapping(address => mapping(bytes11 => data[])) testidmapping;
Used storevalues() function to store and getvalues() to fetch the values
function storevalues(address owner,bytes11 id,uint a,uint b) public{
testidmapping[owner][id].push(data(a,b));
}
function getvalues(address owner,bytes11 id) view returns (uint a){
data storage k = testidmapping[owner][id];
return (k.a);
}
Is this the possible way of double mapping for fetching and storing details? But I am getting this error:
BigNumber() is not a number: (id is printing)
Help will be appreciated...
data(a,b)
in functionstorevalues
? Variablesa
andb
are not defined anywhere!