I have a method in solidity:
function getVotesWithParams(
address account,
uint256 blockNumber,
bytes memory params
) public view virtual override returns (uint256) {
return _getVotes(account, blockNumber, params);
}
It takes in a bytes params, that bytes params is suppose to represent a struct:
struct VoteOptions {
uint24 supportOption;
uint24 percent;
}
Type chain generates this struct to represent it:
export type VoteChoicesStruct = {
name: PromiseOrValue<string>;
data: PromiseOrValue<BytesLike>;
};
I'm creating that struct in a test like so:
const voteOptions: VoteOptionsStruct[] = [{ supportOption: BigNumber.from(0), percent: BigNumber.from(1000)}]
const voteData = defaultAbiCoder.encode(["bytes"], [voteOptions]);
When I try to encode it into bytes I get an error:
Error: invalid arrayify value (argument="value", value=[{"type":"BigNumber","hex":"0x00"},{"type":"BigNumber","hex":"0x03e8"}], code=INVALID_ARGUMENT, version=bytes/5.7.0)