-
Notifications
You must be signed in to change notification settings - Fork 708
New issue
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
Indexed string in event cannot be parsed #57
Comments
Thanks for the clarification... can you post your Event DTO? |
Also please raise another issue if it is changed :) (obviously not now) |
Hi Juan, Here is the DTO for them. Thanks.
|
The C# code to get the events:
Event Multiplied (with DTO EventMultiplied) works well. The only difference I can find is the "indexed" string. |
Short story, retrieving the indexed values for dynamic types (strings, arrays) is not supported. |
So for example if you look at the index topic for "Hello world" it retrieves ed6c11b0b5b808960df26f5bfc471d04c1995b0ffd2055925ad1be28d6baadfd |
Keeping it open as I need to validate the data part |
I see. Thanks. |
I have just pushed a fix which will allow to have indexed dynamic types as part of the Event DTO, mainly they will store the sha3 keccak string. This will prevent an error to be thrown, when decoding. A further solution for your problem if you want to have the index and value of the string will be to have 2 event parameters, 1 for the index and another for the value. |
Thanks for the prompt solution Juan! |
Hi,
I deployed a straight forward smart contract as below and used GetAllChanges to get all events from block 0. GetAllChanges functions throws overflow exception when I tried to get the MultipliedLog event :
Value was either too large or too small for an Int32
My testing shows that it happens when I put a "indexed" keyword after a string. Is it expected?
event Multiplied(uint indexed a, uint indexed result, string hello);
event MultipliedLog(uint indexed a, address indexed sender, string indexed hello);
The text was updated successfully, but these errors were encountered: