Hi all. This PR adds fixes for https://github.com/weiroll/weiroll.js/pull/34 and https://github.com/weiroll/weiroll/issues/56. It checks whether the array/tuple is fixed size or dynamic. If it's fixed, the parameter's value is broken up into 32 byte chunks and set as individual values in the state array. I've added some tests to confirm the functionality.
As far as I can tell this only works for literal values, if I attempt to pass a return value into an array or tuple I get this error: Error: invalid BigNumber value... since we're passing a ReturnValue object into the contract's function instead of a BigNumber. I suspect this requires further changes to the Contract type provided by planner.ts. Although I'm unsure what exactly is needed to fix this. Should I make this a separate issue or would you like it resolve in this PR?
Hi all. This PR adds fixes for https://github.com/weiroll/weiroll.js/pull/34 and https://github.com/weiroll/weiroll/issues/56. It checks whether the array/tuple is fixed size or dynamic. If it's fixed, the parameter's value is broken up into 32 byte chunks and set as individual values in the
state
array. I've added some tests to confirm the functionality.As far as I can tell this only works for literal values, if I attempt to pass a return value into an array or tuple I get this error:
Error: invalid BigNumber value...
since we're passing a ReturnValue object into the contract's function instead of a BigNumber. I suspect this requires further changes to theContract
type provided by planner.ts. Although I'm unsure what exactly is needed to fix this. Should I make this a separate issue or would you like it resolve in this PR?