I have a function call which only accepts bytes data (dydx _getCallActions)
_getCallAction(bytes memory data)
During contract execution the data is passed to a user defined function named: "callFunction"
When decoding into a single struct, it works, however I want to to decode the data into two separate structs.
function callFunction(bytes calldata _data){
// This works, when passed in encoded data matching Struct1Type
Struct1Type memory data1 = abi.decode(_data, (Struct1Type));
}
function callFunction(bytes calldata _data){
// Doesnt work
Struct1Type memory data1, Struct2Type memory data2 = abi.decode(_data, (Struct1Type,Struct2Type));
}
I could decode the data into a single struct and then selectively cast it into the two desired structs, but this seems gas inefficient