You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
contractTesting {
struct PaddedStruct {
uint128 a;
uint8 b;
bytes32 c;
}
PaddedStruct[2][3][] stor_arr;
function addData() public {
PaddedStruct memory a =PaddedStruct(56, 1, "oi");
PaddedStruct memory b =PaddedStruct(78, 6, "bc");
PaddedStruct memory c =PaddedStruct(89, 4, "sn");
PaddedStruct memory d =PaddedStruct(42, 56, "cn");
PaddedStruct memory e =PaddedStruct(23, 78, "fr");
PaddedStruct memory f =PaddedStruct(445, 46, "br");
PaddedStruct[2][3] memory vec = [[a, b], [c, d], [e, f]];
stor_arr.push(vec);
}
function getThis() publicviewreturns (uint32) {
PaddedStruct[2][3][] memory arr2 = stor_arr;
return arr2.length;
}
}
Calling getThis after addData returns 6, instead it should return 1. If we modify stor_arr to PaddedStruct[2][2][] stor_arr and do all the necessary changes, addData returns 4. I think we are incorrectly merging the first two dimensions into one.
The text was updated successfully, but these errors were encountered:
Calling
getThis
afteraddData
returns 6, instead it should return 1. If we modifystor_arr
toPaddedStruct[2][2][] stor_arr
and do all the necessary changes,addData
returns 4. I think we are incorrectly merging the first two dimensions into one.The text was updated successfully, but these errors were encountered: