graphprotocol / support

Community support for the Hosted Service of The Graph
https://thegraph.com/
10 stars 3 forks source link

Feature request: add event name to EthereumEvent class #53

Open iherger opened 4 years ago

iherger commented 4 years ago

For general event logging purposes, it would be very useful to have access to the event name in the EthereumEvent class.

E.g. if my subgraph manifest contains

eventHandlers:
  - event: PriceUpdate(address[],uint256[])
    handler: handlePriceUpdate

I would like to be able to do something like

export function handlePriceUpdate(event: PriceUpdate): void {
  saveEvent(event);
  // other code
}

My current solution also works, but is more manual and therefore error prone:

export function handlePriceUpdate(event: PriceUpdate): void {
  saveEvent("PriceUpdate", event);
  // other code
}