ethereum-abi-types-generator icon indicating copy to clipboard operation
ethereum-abi-types-generator copied to clipboard

Incorrect web3 typings for `bytes[]`

Open r0b1n opened this issue 2 years ago • 1 comments

When generating web3 typings for bytes[] and alike, the resulting typings are incorrect. While bytes is correctly represented as string | number[] (string or array of numbers), bytes[] is represented as follows:

Actual: string | number[][] - this means string OR two-dimensional array of numbers. Expected: (string | number[])[] - array of (string or array of numbers)

This behaviour is actually tested here :

expect(
    TypeScriptHelpers.getSolidityInputTsTypeByTypeName(
        'bytes[][][]',
        Provider.web3
    )
).toEqual('string | number[][][][]');

I believe it should result in (string | number[])[][][] not string | number[][][][].

r0b1n avatar Feb 05 '23 15:02 r0b1n

yes you are right web3 is not as well submitted as ethos will fix this though thanks for raising

joshstevens19 avatar May 21 '23 17:05 joshstevens19