Skip to content

fix: correct array type casting for indexed event parameters in generated contract wrappers#2274

Open
Dev10-sys wants to merge 2 commits intoLFDT-web3j:mainfrom
Dev10-sys:fix/bytes32-array-cast-error
Open

fix: correct array type casting for indexed event parameters in generated contract wrappers#2274
Dev10-sys wants to merge 2 commits intoLFDT-web3j:mainfrom
Dev10-sys:fix/bytes32-array-cast-error

Conversation

@Dev10-sys
Copy link
Copy Markdown
Contributor

Fixes a bug where indexed array event parameters (like bytes32[]) were generated with the wrong type in contract wrappers.

They were being treated as byte[], which caused runtime errors. Now they are correctly handled as List<byte[]>.


Why is it needed?

Right now, events with array parameters can fail at runtime because of incorrect casting.

This change fixes that and makes sure array values are decoded properly.


Additional notes

  • Added a test for bytes32[] handling
  • Changes are small and limited to code generation
  • No impact on other types

Fixes #1994

…FDT-web3j#1994)

Fixes issue LFDT-web3j#1994 where indexed array event parameters (e.g., bytes32[])
were incorrectly cast to �yte[] instead of List<byte[]>, leading to
ClassCastException in generated Java wrappers.

Signed-off-by: Dev10-sys <kalpanagola9897@gmail.com>
Signed-off-by: Dev10-sys <dev10.sys@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generated Contract Error: Cannot cast from List to byte[]

1 participant