-
Notifications
You must be signed in to change notification settings - Fork 777
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
Bug parsing events when nested events involved #1134
Comments
can i hop on this? @NikitaMishin |
hi @NikitaMishin i will love to hop on this one |
also if several components have same name for event getAbiEvents would just shallow rewrite it, |
@NikitaMishin please can you kindly assign this task to me. I'll start working on it and revert |
Hello @NikitaMishin , |
Hi!
|
What's the content of |
just to specify indexed keys like maker and taker for this particular event. u can omit specifying them and put [] |
The first key is |
Seems to be the hash of |
OK, I have now a good understanding of this problem. |
@PhilippeR26, this issue is related. I assume getAbiEvents does not take the component hash into account. If two events have the same base name, it will overwrite one with the other. For example, I defined similar events with the same name "Deposit" in two components, and it resulted in an incorrect ABI, only recognizing one of the events instead of both. For this maybe would be sufficient to have getAbiComponentEvents to avoid breaking change for people who uses getAbiEvents and just mention about this somewhere in the docs? |
I think it's a good guideline to not have 2 times the same name in an abi. Otherwise you are going straight to problems. |
Yes, possible (if i correctly understood your q): |
My question was : is it possible to use in Cairo a component in a component? |
yes in a sense that you can interact with other components in component |
🥴 I don't know how to ask my question in an understandable way ... |
oh, this one i dont know tbh i think not possible (but need some cairo dev let me ask some guys) |
Hello,
Now, the result contains the full name of the event (was just the last word), to differentiate the events with the same name. |
ok, ill try in a tad later today, thanks! |
For the test suite of Starknet.js, could you provide me a link in Sepolia for an example these events :
|
yeap works |
Do you have also in your code an example of a nested event tagged |
they are on same block |
Found some |
top! very quick, thanks! |
Location: https://github.com/starknet-io/starknet.js/blob/66a5c0341eccfef0dcdf1312c15627b7d4f6b675/src/utils/events/index.ts#L52C21-L52C28
Encounter issue with parsing events emitted by components:
Sample of code (just take any events that emitted in nested components):
produces 0 parsed events
Reason: AbiEvents not handle correctly case for nested events when they defined by extra key that associated with component. In my particular case second key was the correct one to do lookup to abiEvents
Potential solution:
iterate over all keys/or first N instead of just first one. I presume there should be no collisions
The text was updated successfully, but these errors were encountered: