You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can see events listed on the main page as expected, but if you check this block on your IDE you see that types are wrong
I couldn't find a fast solution for this and then I thought:
Why do we even need that workaround to get Ethers.js-like behavior in Wagmi/Viem? In general, it only adds a mess when working with events. For me, if event arguments are named, then get it like event.args?.newGreeting. If your arguments are unnamed, get it like event.args?.[0]. But when you can get the same event arguments both ways, it only adds ambiguity to codebase.
Again, Explicit is better than implicit. So I think it's better just to remove those additional indexed arguments.
What do you think?
The text was updated successfully, but these errors were encountered:
Again, Explicit is better than implicit. So I think it's better just to remove those additional indexed arguments.
++ I think this makes a lot of sense and we should remove it! I think the reason we always sugarcoat with indexed params is because of this : scaffold-eth/se-2-challenges#93
^ The above could be solved by updating the challenge readme and asking people to be mindful about args name + also maybe mentioning this behaviour in SE-2 docs?
++ I think this makes a lot of sense and we should remove it! I think the reason we always sugarcoat with indexed params is because of this : scaffold-eth/se-2-challenges#93
Yes, it worked for some time but now people get that type error for example if they use named arguments in challenge 1 (I think cursor add it most of the time).
^ The above could be solved by updating the challenge readme and asking people to be mindful about args name + also maybe mentioning this behaviour in SE-2 docs?
In #540 we added indexed args to events. But types for indexed arguments are still not supported (or it broke someday)
How to reproduce:
app/page.tsx
code:Details
I couldn't find a fast solution for this and then I thought:
Why do we even need that workaround to get Ethers.js-like behavior in Wagmi/Viem? In general, it only adds a mess when working with events. For me, if event arguments are named, then get it like
event.args?.newGreeting
. If your arguments are unnamed, get it likeevent.args?.[0]
. But when you can get the same event arguments both ways, it only adds ambiguity to codebase.Again, Explicit is better than implicit. So I think it's better just to remove those additional indexed arguments.
What do you think?
The text was updated successfully, but these errors were encountered: