We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After generating a contract from the abi and bin the class has a casting error.
The contract is probably trying to parse this solidity event:
event GameEnded(bytes32 indexed gameId, bytes32[] indexed winners, uint256 time);
And it is having an hard time to convert the array of bytes32. This is the code where the error:
Cannot cast from List to byte[]Java(16777372) List org.web3j.abi.datatypes.Array.getNativeValueCopy()
occurs at lines:
typedResponse.winners = (byte[]) ((Array) eventValues.getIndexedValues().get(1)).getNativeValueCopy();
and
public static List<GameEndedEventResponse> getGameEndedEvents(TransactionReceipt transactionReceipt) { List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(GAMEENDED_EVENT, transactionReceipt); ArrayList<GameEndedEventResponse> responses = new ArrayList<GameEndedEventResponse>(valueList.size()); for (Contract.EventValuesWithLog eventValues : valueList) { GameEndedEventResponse typedResponse = new GameEndedEventResponse(); typedResponse.log = eventValues.getLog(); typedResponse.gameId = (byte[]) eventValues.getIndexedValues().get(0).getValue(); typedResponse.winners = (byte[]) ((Array) eventValues.getIndexedValues().get(1)).getNativeValueCopy(); typedResponse.time = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue(); responses.add(typedResponse); } return responses; }
it can be solved by writing it like the byte32 gameId event but I think that it get only one value of the array.
typedResponse.winners = (byte[]) eventValues.getIndexedValues().get(1).getValue();
Hope this is just a quick simple error, thank you for your time.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
After generating a contract from the abi and bin the class has a casting error.
The contract is probably trying to parse this solidity event:
And it is having an hard time to convert the array of bytes32.
This is the code where the error:
occurs at lines:
and
it can be solved by writing it like the byte32 gameId event but I think that it get only one value of the array.
Hope this is just a quick simple error, thank you for your time.
The text was updated successfully, but these errors were encountered: