graph-node icon indicating copy to clipboard operation
graph-node copied to clipboard

Can't access event parameters if they are a struct

Open yehia67 opened this issue 3 years ago • 1 comments

Hey, I have an event with struct as a parameter event UserUpdated(User _user); On the event handler handleUserUpdated I access the event parameter this way event.params._user.amountOfAsset1 When I access events, I get this error on the graph studio Ethereum value is not a tuple. I checked the generated file (generated/contractName/fileName.ts) and found this

get _user(): UserUpdated_userStruct { return changetype<UserUpdated_userStruct>( this._event.parameters[0].value.toTuple() ); }

Any idea how to fix it, please?

yehia67 avatar Aug 30 '22 08:08 yehia67

Hello - can you provide an example subgraph with this issue? Specifically of interest is the ABI and the event signature used to define the handler, which should be a tuple, rather than a named struct

azf20 avatar Sep 01 '22 11:09 azf20

Looks like this issue has been open for 6 months with no activity. Is it still relevant? If not, please remember to close it.

github-actions[bot] avatar Mar 01 '23 00:03 github-actions[bot]

it was an ABI problem, Sorry I didn't see your reply @azf20

yehia67 avatar Mar 07 '23 15:03 yehia67